feat: improve handling of stays

This commit is contained in:
Matilda Landström
2024-07-16 17:21:58 +02:00
committed by Michael Zetterberg
parent e733ce283a
commit f46207a308
11 changed files with 39 additions and 46 deletions

View File

@@ -19,9 +19,13 @@ export default function ClientPreviousStays({
}: PreviousStaysClientProps) {
const { data, isFetching, fetchNextPage, hasNextPage, isLoading } =
trpc.user.stays.previous.useInfiniteQuery(
{},
{
getNextPageParam: (lastPage) => lastPage?.nextCursor,
limit: 6,
},
{
getNextPageParam: (lastPage) => {
return lastPage?.nextCursor
},
initialData: {
pageParams: [undefined, 1],
pages: [initialPreviousStays],