-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Currently, every time we want to get the user, or fetch all projects, or anything else, we create a whole react query call inside the component, defining a query key and api route that we call.
We should abstract this away into our own custom hooks that call react query queries. This way, this
const { data, isLoading, isError } = useQuery({ queryKey: ["allProjects"], queryFn: async () => { const response = await axios.get("/api/projects"); return response.data; }, });
can just be a single line in any given file.
Reactions are currently unavailable