fix: favourites pages -> clien side
This commit is contained in:
1 parent
09e959d3d4
commit
0f5c73c183
4 files changed
+6
-40
No files matched your search
@@ -1,10 +1,6 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { Metadata } from 'next';
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import usersShowsQuery from '@/data/queries/usersShows';
|
||||
import { TITLE } from '@/env';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import UsersList from '../components/UsersLists';
|
||||
|
||||
@@ -13,21 +9,8 @@ export const metadata: Metadata = {
|
||||
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`
|
||||
};
|
||||
|
||||
const Favorites = async () => {
|
||||
const session = cookies().get('session')?.value;
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const list = 'favorite';
|
||||
|
||||
if (session) {
|
||||
await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType: 'movie', session, list }));
|
||||
}
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<UsersList session={session} list={list} label='favorites' />
|
||||
</HydrationBoundary>
|
||||
);
|
||||
const Favorites = () => {
|
||||
return <UsersList list='favorite' label='favorites' />;
|
||||
};
|
||||
|
||||
export default Favorites;
|
||||
Reference in new issue
Block a user