Files
movie-advisor/app/(site)/top/usePerson.ts
T
2023-08-09 18:43:48 +03:00

10 lines
273 B
TypeScript

import { useQuery } from '@tanstack/react-query';
import API from './api';
const usePerson = ({ id }: { id: string | null }) => {
return useQuery({ enabled: Boolean(id), queryKey: ['person', id], queryFn: () => API.person({ id: id! }) });
};
export default usePerson;