feat: account
This commit is contained in:
1 parent
df0f7c943b
commit
043375f44a
17 files changed
+305
-131
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { usersShows } from '@/api';
|
||||
import useInfiniteList from './useInfiniteList';
|
||||
import { useSession } from './useSession';
|
||||
|
||||
const useFavorites = ({
|
||||
showType,
|
||||
listType = 'favorites'
|
||||
}: {
|
||||
showType: Show['type'];
|
||||
listType: 'favorites' | 'watchlist';
|
||||
}) => {
|
||||
const session = useSession();
|
||||
|
||||
return useInfiniteList({
|
||||
queryKey: [`users-${listType}`, showType],
|
||||
queryFn: () => usersShows({ showType, listType }),
|
||||
enabled: Boolean(session)
|
||||
});
|
||||
};
|
||||
|
||||
export default useFavorites;
|
||||
Reference in new issue
Block a user