refactoring: improved types
This commit is contained in:
1 parent
272178d668
commit
5c42608e99
10 files changed
+93
-88
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user