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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user