feat: add sort to community search page

This commit is contained in:
Xyphyn committed 2023-09-03 18:12:10 -07:00
1 parent d3ba6d969c
commit e9168d055e
7 files changed
+79 -55

No files matched your search

+4 -2
View File
@@ -16,8 +16,8 @@ export async function load({ url, fetch }) {
const query = url.searchParams.get('q')
const page = Number(url.searchParams.get('page')) || 1
const community = url.searchParams.get('community_name')
const sort = url.searchParams.get('sort')
const type = url.searchParams.get('type')
const sort = url.searchParams.get('sort') || 'New'
const type = url.searchParams.get('type') || 'All'
if (query) {
const results = await getClient(undefined, fetch).search({
@@ -44,6 +44,8 @@ export async function load({ url, fetch }) {
)
return {
type: type,
sort: sort,
page: page,
results: everything,
streamed: {