Skip to content

Commit d399a2c

Browse files
committed
hotfix: 커서 관련 오류 해결
1 parent 6df95d0 commit d399a2c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/(with-tracker)/(auth-required)/main/Content.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export const Content = () => {
2727

2828
const { data: posts, fetchNextPage } = useInfiniteQuery({
2929
queryKey: [PATHS.POSTS, [searchParams.asc, searchParams.sort]], // Query Key
30-
queryFn: async ({ pageParam }) =>
30+
queryFn: async ({ pageParam = '' }) =>
3131
await postList(
3232
{},
3333
{ asc: searchParams.asc === 'true', sort: searchParams.sort || '' },
3434
pageParam,
3535
),
36-
getNextPageParam: (lastPage) => Number(lastPage.nextCursor.split(',')[1]),
37-
getPreviousPageParam: () => 0,
38-
initialPageParam: undefined,
36+
getNextPageParam: (lastPage) => lastPage.nextCursor,
37+
getPreviousPageParam: () => '',
38+
initialPageParam: '',
3939
});
4040

4141
const { data: summaries } = useQuery({

0 commit comments

Comments
 (0)