test
This commit is contained in:
parent
2b0c954aa5
commit
59ab194b08
@ -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;
|
||||
});
|
||||
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user