feat: add cursor pagination to community pages

This commit is contained in:
Xylight committed 2023-09-30 00:22:41 +00:00
1 parent 0239d6cef9
commit ddd560c463
3 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@ import { feature } from '$lib/version.js'
export async function load({ url, fetch }) {
const cursor = url.searchParams.get('cursor') as string | undefined
const page = Number(url.searchParams.get('page') || 1) || 1
const page = Number(url.searchParams.get('page')) || undefined
const sort: SortType =
(url.searchParams.get('sort') as SortType) ||
@@ -29,7 +29,7 @@ export async function load({ url, fetch }) {
return {
sort: sort,
listingType: listingType,
page: page,
page: page || 1,
posts: posts,
next_page: posts.next_page
}