feat: hey-api and projects fetch
This commit is contained in:
12
src/hooks/useProjectsList.ts
Normal file
12
src/hooks/useProjectsList.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getProjectsOptions } from "@/client/@tanstack/react-query.gen";
|
||||
|
||||
const useProjectsList = () => {
|
||||
const { data, refetch, isLoading } = useQuery({
|
||||
...getProjectsOptions(),
|
||||
});
|
||||
const projects = !data ? [] : data.projects;
|
||||
return { projects, refetch, isLoading };
|
||||
};
|
||||
|
||||
export default useProjectsList;
|
||||
Reference in New Issue
Block a user