feat: add sorting to search page

This commit is contained in:
Xylight committed 2024-03-09 11:23:25 -08:00
1 parent cb21ab02c5
commit 609c8c1b73
3 files changed
+25 -24

No files matched your search

+2 -5
View File
@@ -25,7 +25,7 @@ export async function load({ url, fetch }) {
community_id: community ?? undefined,
limit: 20,
page: page,
sort: (sort as SortType) || 'New',
sort: (sort as SortType) || 'TopAll',
listing_type: 'All',
type_: (type as SearchType) ?? 'All',
})
@@ -37,10 +37,7 @@ export async function load({ url, fetch }) {
results.communities,
]
const everything = [...posts, ...comments, ...users, ...communities].sort(
(a, b) =>
Date.parse(getItemPublished(b)) - Date.parse(getItemPublished(a))
)
const everything = [...posts, ...comments, ...users, ...communities]
return {
type: type,