adds dynamic trail filters

This commit is contained in:
Christian Beutel
2024-04-03 19:09:24 +02:00
parent 35a6115f2b
commit 25f7c9717c
11 changed files with 1149 additions and 54 deletions

View File

@@ -0,0 +1,12 @@
import { type TrailFilterValues } from '$lib/models/trail';
import { pb } from '$lib/pocketbase';
import { error, json, type RequestEvent } from '@sveltejs/kit';
export async function GET(event: RequestEvent) {
try {
const r = await pb.collection('trails_filter').getOne<TrailFilterValues>(pb.authStore.model!.id)
return json(r)
} catch (e: any) {
throw error(e.status, e);
}
}