Bestellen auf Rechnung

This commit is contained in:
Moritz Utcke
2025-02-17 20:46:27 +11:00
parent 7f6430f20f
commit 9951179b2a
16 changed files with 198 additions and 80 deletions

View File

@@ -15,20 +15,12 @@ if (!valid) {
Astro.redirect("/auth/login", 302)
}
const caller = createCaller(Astro)
const benutzer = (await caller.user.self.GET.fetch(undefined, {
headers: {
Authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
}
})) || {} as BenutzerClient;
export interface Props {
title: string;
user: BenutzerClient
}
const { title } = Astro.props;
const { title, user } = Astro.props;
const schema = JSON.stringify({
"@context": "http://schema.org",
@@ -107,7 +99,7 @@ let lightTheme = Astro.cookies.get("theme")?.value === "light";
</head>
<body class="min-h-screen grid md:grid-cols-[300px_1fr]">
<DashboardSidebar lightTheme={lightTheme} {benutzer} client:load></DashboardSidebar>
<DashboardSidebar lightTheme={lightTheme} benutzer={user} client:load></DashboardSidebar>
<main class="p-4 md:p-8 overflow-auto h-screen bg-base-100 pt-20 md:!pt-24">
<slot />
</main>