From 59ab194b08f2ed7bd9c90162c70ea28b4b1f7e95 Mon Sep 17 00:00:00 2001 From: AlexBocken Date: Wed, 19 Jul 2023 15:59:54 +0200 Subject: [PATCH] test --- src/routes/(rezepte)/rezepte/+layout.server.ts | 5 +---- src/routes/(rezepte)/rezepte/+page.server.ts | 3 +-- src/routes/(rezepte)/rezepte/+page.svelte | 6 ++---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/routes/(rezepte)/rezepte/+layout.server.ts b/src/routes/(rezepte)/rezepte/+layout.server.ts index 92aab77..30af304 100644 --- a/src/routes/(rezepte)/rezepte/+layout.server.ts +++ b/src/routes/(rezepte)/rezepte/+layout.server.ts @@ -1,11 +1,8 @@ -import type {LayoutServerLoad} from './$types'; import { authenticateUser } from '$lib/js/authenticate';; export const load = (async ({cookies}) => { const user = await authenticateUser(cookies) - console.log("LOAD LAYOUT") - console.log(user) return { user } -}) satisfies LayoutServerLoad; +}); diff --git a/src/routes/(rezepte)/rezepte/+page.server.ts b/src/routes/(rezepte)/rezepte/+page.server.ts index 882f552..f6e2ade 100644 --- a/src/routes/(rezepte)/rezepte/+page.server.ts +++ b/src/routes/(rezepte)/rezepte/+page.server.ts @@ -1,6 +1,6 @@ import type { PageServerLoad } from "./$types"; -export async function load({ fetch, locals }) { +export async function load({ fetch }) { let current_month = new Date().getMonth() + 1 const res_season = await fetch(`/api/items/in_season/` + current_month); const res_all_brief = await fetch(`/api/items/all_brief`); @@ -9,6 +9,5 @@ export async function load({ fetch, locals }) { return { season: item_season, all_brief: item_all_brief, - user: locals.user, }; }; diff --git a/src/routes/(rezepte)/rezepte/+page.svelte b/src/routes/(rezepte)/rezepte/+page.svelte index 29af60f..9d0ec1c 100644 --- a/src/routes/(rezepte)/rezepte/+page.svelte +++ b/src/routes/(rezepte)/rezepte/+page.svelte @@ -19,7 +19,7 @@ h1{

Rezepte

- + {#each data.season as recipe} {/each} @@ -34,6 +34,4 @@ h1{ {/each} {/each} -{#if data.user && data.user.access.includes("rezepte")} - -{/if} +