fixes front page data load try catch
This commit is contained in:
@@ -4,8 +4,14 @@ import { trails_recommend } from "$lib/stores/trail_store";
|
|||||||
import type { ServerLoad } from "@sveltejs/kit";
|
import type { ServerLoad } from "@sveltejs/kit";
|
||||||
|
|
||||||
export const load: ServerLoad = async ({ params, locals, fetch }) => {
|
export const load: ServerLoad = async ({ params, locals, fetch }) => {
|
||||||
const trails: Trail[] = await trails_recommend(4, fetch)
|
try {
|
||||||
await categories_index(fetch)
|
await categories_index(fetch)
|
||||||
|
|
||||||
return { trails: trails ?? [] }
|
const trails: Trail[] = await trails_recommend(4, fetch)
|
||||||
|
return { trails: trails ?? [] }
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
return { trails: [] }
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user