feat: add sorting to search page
This commit is contained in:
1 parent
cb21ab02c5
commit
609c8c1b73
3 files changed
+25
-24
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user