fix: unmerged posts/comments in user profiles

This commit is contained in:
James Xylight committed 2025-06-06 17:07:58 -07:00
1 parent c7f3c17001
commit 681cef0634
4 files changed
+124 -3

No files matched your search

+3 -1
View File
@@ -9,6 +9,8 @@ export async function load({ params, url, fetch }) {
(url.searchParams.get('type') as 'comments' | 'posts') || 'posts'
const sort: SortType = (url.searchParams.get('sort') as SortType) || 'New'
console.log(type)
const user = await getClient(undefined, fetch).getPersonDetails({
limit: 20,
page: page,
@@ -16,7 +18,7 @@ export async function load({ params, url, fetch }) {
sort: sort,
})
const items = [...user.posts, ...user.comments]
const items = type == 'posts' ? user.posts : user.comments
return {
filters: new ReactiveState({