Merges v0.3.2 patch with main (#48)

* fixes public trail filter values bug

* updates CHANGELOG.md

* bumps version

---------

Co-authored-by: Christian Beutel <>
This commit is contained in:
Flomp
2024-04-05 17:07:46 +02:00
committed by GitHub
parent 2a2a49fd94
commit 50233b41a1
6 changed files with 86 additions and 68 deletions

View File

@@ -3,10 +3,18 @@ import { pb } from '$lib/pocketbase';
import { error, json, type RequestEvent } from '@sveltejs/kit';
export async function GET(event: RequestEvent) {
if (!pb.authStore.model) {
return json({
min_distance: 0,
max_distance: 20000,
min_elevation_gain: 0,
max_elevation_gain: 4000
});
}
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);
throw error(e.status || 500, e);
}
}