Open freefony opened 5 years ago
Currently, each module of the app calls a fetch function to either post or get data from the api which leads to repeating similar code in many places.
fetch
data.js
api.js
get
getAll
I have logged this and going to handle it
Breakdown
Currently, each module of the app calls a
fetch
function to either post or get data from the api which leads to repeating similar code in many places.Tasks
data.js
orapi.js
get
that takes 2 arguments: endpoint, id, and returns the data from that endpoint as and object.getAll
that takes an argument, endpoint and returns an array of objects from the api.Requirements