Verbrauchsausweis Gewerbe

This commit is contained in:
Moritz Utcke
2025-04-09 13:10:11 -04:00
parent 8daee69576
commit a58c8d466e
8 changed files with 174 additions and 136 deletions

View File

@@ -1,23 +1,15 @@
---
import UserLayout from "#layouts/DashboardLayout.astro";
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
import { Enums, prisma } from "#lib/server/prisma";
import { createCaller } from "src/astro-typesafe-api-caller";
import DashboardModule from "#modules/Dashboard/DashboardModule.svelte";
const caller = createCaller(Astro)
import { getCurrentUser } from "#lib/server/user";
const params = Astro.params;
const page = Number(params.page)
const id = Astro.url.searchParams.get("id") || undefined;
const user = await caller.user.self.GET.fetch(undefined, {
headers: {
"Authorization": `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
}
});
const user = await getCurrentUser(Astro)
if (!user) {
return Astro.redirect("/auth/login")