feat: add pageination to saved psots

This commit is contained in:
Xyphyn committed 2023-10-09 16:44:47 -07:00
1 parent 19c5ee77d1
commit 0ddba53b03
3 files changed
+17 -9

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ function getSavedItemPublished(item: PostView | CommentView) {
}
export async function load({ url, fetch }) {
if (!get(profile)) return { posts: [] }
if (!get(profile)) return { posts: [], page: 0 }
const page = Number(url.searchParams.get('page')) || 1
const client = getClient(undefined, fetch)
@@ -43,5 +43,5 @@ export async function load({ url, fetch }) {
Date.parse(getSavedItemPublished(a))
)
return { data: everything }
return { page: page, data: everything }
}