- Create a API folder in the route directory - abstract all the fetching functions into this API folder where each folder represent a route. - if it is nested inside a route then add the fetching function inside a folder. - Now use that function and fetch queries using useQuery instead of normal fetch functions.
Create a API folder in the route directory
abstract all the fetching functions into this API folder where each folder represent a route.
if it is nested inside a route then add the fetching function inside a folder.
Now use that function and fetch queries using useQuery instead of normal fetch functions.