touchups after refactor

This commit is contained in:
Christian Beutel
2025-01-03 00:13:59 +01:00
parent 871481a84e
commit 0d2e71c2f6
32 changed files with 1157 additions and 45 deletions

View File

@@ -7,7 +7,8 @@ export async function activities_index(author: string, page: number = 1, perPage
const r = await f('/api/v1/activity?' + new URLSearchParams({
"perPage": perPage.toString(),
page: page.toString(),
filter: `author="${author}"`
filter: `author="${author}"`,
sort: "-created"
}), {
method: 'GET',
})

View File

@@ -8,7 +8,7 @@ export async function notifications_index(data: { recipient: string, seen?: bool
filter: `created>=@month&&recipient='${data.recipient}'` + (data.seen !== undefined ? `&&seen=${data.seen}` : ''),
sort: '+seen,-created',
page: page.toString(),
"per-page": perPage.toString()
"perPage": perPage.toString()
}), {
method: 'GET',
})

View File

@@ -18,7 +18,7 @@ export const editTrail: Writable<Trail> = writable(new Trail(""));
export async function trails_index(perPage: number = 21, random: boolean = false, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
const r = await f('/api/v1/trail?' + new URLSearchParams({
"per-page": perPage.toString(),
"perPage": perPage.toString(),
expand: "category,waypoints,summit_logs",
sort: random ? "@random" : "",
}), {
@@ -102,7 +102,7 @@ export async function trails_search_bounding_box(northEast: M.LngLat, southWest:
}
r = await fetch('/api/v1/trail?' + new URLSearchParams({
"per-page": "-1",
"perPage": "-1",
filter: `'${trailIds.join(',')}'~id`,
expand: "category,waypoints,summit_logs",
sort: `+name`,