feat: add cursor pagination to community pages
This commit is contained in:
1 parent
0239d6cef9
commit
ddd560c463
3 files changed
+8
-4
No files matched your search
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user