diff --git a/src/frontend/src/routes/+page.server.ts b/src/frontend/src/routes/+page.server.ts index a64fb0f..76d35c2 100644 --- a/src/frontend/src/routes/+page.server.ts +++ b/src/frontend/src/routes/+page.server.ts @@ -13,7 +13,7 @@ export const load: PageServerLoad = async ({ fetch, url }) => { fetch }); - if (error) { + if (error || !data || !data.systems) { return new Response(`Failed to fetch: ${error}`, { status: response.status }); } diff --git a/src/frontend/src/routes/+page.svelte b/src/frontend/src/routes/+page.svelte index 4f5f161..4467f4a 100644 --- a/src/frontend/src/routes/+page.svelte +++ b/src/frontend/src/routes/+page.svelte @@ -18,6 +18,9 @@ const inParams: FlyParams = { y: '100%', duration: 300, easing: cubicOut }; const outParams: FlyParams = { x: '100%', duration: 700, easing: cubicOut }; const animateParams: AnimationConfig = { delay: 0, duration: 300, easing: cubicOut }; + + const systems = data.systems!; + const form = data.form!; @@ -29,12 +32,12 @@
- {#each data.systems as system (system.id)} + {#each systems as system (system.id)}
@@ -43,7 +46,7 @@
- + diff --git a/src/frontend/src/routes/public/[id]/+page.server.ts b/src/frontend/src/routes/public/[id]/+page.server.ts index beee863..493f350 100644 --- a/src/frontend/src/routes/public/[id]/+page.server.ts +++ b/src/frontend/src/routes/public/[id]/+page.server.ts @@ -17,11 +17,11 @@ export const load: PageServerLoad = async ({ fetch, params, url }) => { fetch }); - if (error) { + if (error || !data || !data.system) { return new Response(`Failed to fetch: ${error}`, { status: response.status }); } return { - system: data!.system + system: data.system }; }; diff --git a/src/frontend/src/routes/public/[id]/+page.svelte b/src/frontend/src/routes/public/[id]/+page.svelte index ce82350..8664b93 100644 --- a/src/frontend/src/routes/public/[id]/+page.svelte +++ b/src/frontend/src/routes/public/[id]/+page.svelte @@ -8,11 +8,13 @@ let { data }: { data: PageData } = $props(); - title.set(data.system.name + ' status'); + const system = data.system!; + + title.set(system.name + ' status');
- +