This commit is contained in:
Alexander Bocken 2023-07-19 15:59:54 +02:00
parent 2b0c954aa5
commit 59ab194b08
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
3 changed files with 4 additions and 10 deletions

View File

@ -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;
});

View File

@ -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,
};
};

View File

@ -19,7 +19,7 @@ h1{
</style>
<h1>Rezepte</h1>
<section>
<MediaScroller title="In Saison:">
<MediaScroller title="In Saison">
{#each data.season as recipe}
<Card {recipe} {current_month} search=""></Card>
{/each}
@ -34,6 +34,4 @@ h1{
{/each}
</MediaScroller>
{/each}
{#if data.user && data.user.access.includes("rezepte")}
<AddButton></AddButton>
{/if}