refactoring: improved types

This commit is contained in:
ner committed 2024-10-10 17:10:37 +03:00
1 parent 272178d668
commit 5c42608e99
10 files changed
+93 -88

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { useQuery } from '@tanstack/react-query';
import { details } from '@/api';
const useDetails = ({ showId, showType = 'movie' }: { showId?: Show['id']; showType?: Show['type'] }) =>
useQuery({
enabled: Boolean(showId && showType),
queryKey: ['details', showId, showType],
queryFn: () => details({ showId: showId!, showType })
});
export default useDetails;