fix: favorites pagination
This commit is contained in:
1 parent
8858e47d38
commit
38f0ca26da
4 files changed
+11
-7
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import { usersShows } from '@/api';
|
||||
|
||||
import useInfiniteList from './useInfiniteList';
|
||||
import { useSession } from './useSession';
|
||||
import { useFavorites, useWatchList } from './useLocalUsersLists';
|
||||
import { useSession } from './useSession';
|
||||
|
||||
export const KEY = ({ list, showType }: { showType: Show['type']; list: 'favorite' | 'watchlist' }) => [
|
||||
`users-${list}`,
|
||||
@@ -16,7 +17,7 @@ const useUsersShows = ({ showType, list = 'favorite' }: { showType: Show['type']
|
||||
|
||||
const query = useInfiniteList({
|
||||
queryKey: KEY({ list, showType }),
|
||||
queryFn: () => usersShows({ showType, list }),
|
||||
queryFn: ({ page }) => usersShows({ showType, list, page }),
|
||||
enabled: Boolean(session)
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user