feat: series

This commit is contained in:
ner committed 2024-06-19 18:28:17 +03:00
1 parent b2eef6c494
commit 1e31520c92
25 files changed
+435 -223

No files matched your search

+3 -3
View File
@@ -4,12 +4,12 @@ import { useInfiniteQuery } from '@tanstack/react-query';
import { similarMovies } from '@/lib/api';
const useSimilar = ({ movieId }: { movieId?: string }) => {
const useSimilar = ({ movieId, type = 'movie' }: { movieId?: string; type?: ShowType }) => {
return useInfiniteQuery({
queryKey: ['similar', movieId],
queryKey: ['similar', movieId, type],
enabled: Boolean(movieId),
queryFn: ({ pageParam }) => {
return similarMovies({ page: pageParam as string, movieId });
return similarMovies({ page: pageParam as string, movieId, type });
},
getNextPageParam(lastPage) {
const { page, total_pages } = lastPage as { page: number; total_pages: number };