Implemented the new react version of the frontend
This commit is contained in:
1 parent
236e6e06fb
commit
ffe7e52527
65 files changed
+5228
-177
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { peopleApi } from '@/api/people';
|
||||
|
||||
export const peopleKeys = {
|
||||
all: ['people'] as const,
|
||||
detail: (id: number) => ['people', id] as const,
|
||||
};
|
||||
|
||||
export function usePerson(id: number) {
|
||||
return useQuery({
|
||||
queryKey: peopleKeys.detail(id),
|
||||
queryFn: () => peopleApi.getById(id),
|
||||
enabled: !!id,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user