From f8e890e9a98c5fa587a85166c4e86da3fd97251a Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Mon, 21 Apr 2025 19:09:57 -0300 Subject: [PATCH] =?UTF-8?q?Best=C3=A4tigungsmail=20weg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/astro-typesafe-api-caller.ts | 2 +- src/pages/api/admin/ausstellen.ts | 1 + src/pages/speichern-erfolgreich.astro | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts index 9d4a1e70..78e89147 100644 --- a/src/astro-typesafe-api-caller.ts +++ b/src/astro-typesafe-api-caller.ts @@ -11,13 +11,13 @@ export const createCaller = createCallerFactory({ "admin/nicht-ausstellen": await import("../src/pages/api/admin/nicht-ausstellen.ts"), "admin/registriernummer": await import("../src/pages/api/admin/registriernummer.ts"), "admin/stornieren": await import("../src/pages/api/admin/stornieren.ts"), + "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), "ausweise": await import("../src/pages/api/ausweise/index.ts"), "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), "auth/passwort-vergessen": await import("../src/pages/api/auth/passwort-vergessen.ts"), "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), "bedarfsausweis-gewerbe/[id]": await import("../src/pages/api/bedarfsausweis-gewerbe/[id].ts"), "bedarfsausweis-gewerbe": await import("../src/pages/api/bedarfsausweis-gewerbe/index.ts"), - "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), "bedarfsausweis-wohnen/[id]": await import("../src/pages/api/bedarfsausweis-wohnen/[id].ts"), "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), "bilder/[id]": await import("../src/pages/api/bilder/[id].ts"), diff --git a/src/pages/api/admin/ausstellen.ts b/src/pages/api/admin/ausstellen.ts index bac3e422..aa77088f 100644 --- a/src/pages/api/admin/ausstellen.ts +++ b/src/pages/api/admin/ausstellen.ts @@ -105,6 +105,7 @@ export const GET = defineApiRoute({ code: "BAD_REQUEST", message: "Die Rechnung konnte bei LexOffice nicht angelegt werden..", + cause: error }); } diff --git a/src/pages/speichern-erfolgreich.astro b/src/pages/speichern-erfolgreich.astro index ae1f82a8..bca0234e 100644 --- a/src/pages/speichern-erfolgreich.astro +++ b/src/pages/speichern-erfolgreich.astro @@ -3,6 +3,7 @@ import Layout from "#layouts/Layout.astro"; import { BASE_URI } from "#lib/constants"; import { transport } from "#lib/mail"; import { getPrismaAusweisAdapter } from "#lib/server/ausweis"; +import { Enums } from "#lib/server/prisma"; import { getCurrentUser } from "#lib/server/user"; const user = await getCurrentUser(Astro) @@ -12,6 +13,11 @@ if (!user || !id) { return Astro.redirect("/") } +// Wir wollen keine Bestätigungsmail wenn ein Admin speichert. +if (user.rolle === Enums.BenutzerRolle.ADMIN) { + return Astro.redirect("/dashboard") +} + const adapter = getPrismaAusweisAdapter(id || "") if (!adapter) {