diff --git a/src/components/PlzSuche.svelte b/src/components/PlzSuche.svelte
index c909c962..4d17c152 100644
--- a/src/components/PlzSuche.svelte
+++ b/src/components/PlzSuche.svelte
@@ -47,7 +47,7 @@
{
hideZipDropdown = true;
-}}>
+}} class="relative">
{
diff --git a/src/generated/zod/index.ts b/src/generated/zod/index.ts
index 37875cdf..7a3650d7 100644
--- a/src/generated/zod/index.ts
+++ b/src/generated/zod/index.ts
@@ -1,23 +1,23 @@
-export * from "./anteilshaber"
-export * from "./apirequests"
-export * from "./aufnahme"
-export * from "./bedarfsausweisgewerbe"
-export * from "./bedarfsausweiswohnen"
-export * from "./benutzer"
-export * from "./bild"
-export * from "./event"
-export * from "./gegeinpreisung"
-export * from "./gegnachweisgewerbe"
-export * from "./gegnachweiswohnen"
-export * from "./klimafaktoren"
-export * from "./objekt"
-export * from "./postleitzahlen"
-export * from "./rechnung"
-export * from "./refreshtokens"
-export * from "./tickets"
-export * from "./unterlage"
-export * from "./verbrauchsausweisgewerbe"
-export * from "./verbrauchsausweiswohnen"
-export * from "./documenttemplates"
-export * from "./documenttypes"
-export * from "./tokens"
+export * from "./anteilshaber.js"
+export * from "./apirequests.js"
+export * from "./aufnahme.js"
+export * from "./bedarfsausweisgewerbe.js"
+export * from "./bedarfsausweiswohnen.js"
+export * from "./benutzer.js"
+export * from "./bild.js"
+export * from "./event.js"
+export * from "./gegeinpreisung.js"
+export * from "./gegnachweisgewerbe.js"
+export * from "./gegnachweiswohnen.js"
+export * from "./klimafaktoren.js"
+export * from "./objekt.js"
+export * from "./postleitzahlen.js"
+export * from "./rechnung.js"
+export * from "./refreshtokens.js"
+export * from "./tickets.js"
+export * from "./unterlage.js"
+export * from "./verbrauchsausweisgewerbe.js"
+export * from "./verbrauchsausweiswohnen.js"
+export * from "./documenttemplates.js"
+export * from "./documenttypes.js"
+export * from "./tokens.js"
diff --git a/src/layouts/DashboardLayout.astro b/src/layouts/DashboardLayout.astro
index cd8c3602..4298dbb3 100644
--- a/src/layouts/DashboardLayout.astro
+++ b/src/layouts/DashboardLayout.astro
@@ -1,7 +1,7 @@
---
// import "svelte-ripple-action/ripple.css";
import "../style/global.css";
-import "../../svelte-dialogs.config";
+import "../../svelte-dialogs.config.js";
import DashboardSidebar from "../components/Dashboard/DashboardSidebar.svelte";
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
import { BenutzerClient } from "#components/Ausweis/types";
diff --git a/src/modules/Dashboard/DashboardAufnahmeModule.svelte b/src/modules/Dashboard/DashboardAufnahmeModule.svelte
index 0f33fe26..41230fb6 100644
--- a/src/modules/Dashboard/DashboardAufnahmeModule.svelte
+++ b/src/modules/Dashboard/DashboardAufnahmeModule.svelte
@@ -2,7 +2,7 @@
import { AufnahmeKomplettClient, BenutzerClient } from "#components/Ausweis/types.js";
import Carousel from "#components/Carousel.svelte";
import DashboardAusweis from "#components/Dashboard/DashboardAusweis.svelte";
- import { Objekt } from "#lib/client/prisma";
+ import { Objekt } from "#lib/client/prisma.js";
import { ChevronLeft, ChevronRight } from "radix-svelte-icons";
export let user: BenutzerClient;
diff --git a/src/modules/Dashboard/DashboardEinstellungenModule.svelte b/src/modules/Dashboard/DashboardEinstellungenModule.svelte
index 3e90f16c..9da98aa8 100644
--- a/src/modules/Dashboard/DashboardEinstellungenModule.svelte
+++ b/src/modules/Dashboard/DashboardEinstellungenModule.svelte
@@ -5,34 +5,32 @@
Cube,
Person,
} from "radix-svelte-icons";
- import { Tabs, Tab, TabList, TabPanel } from "../../components/Tabs";
- import { dialogs } from "../../../svelte-dialogs.config";
- import { BenutzerClient } from "#components/Ausweis/types";
- // import { client } from "src/trpc";
- import { exclude } from "#lib/exclude";
+ import { Tabs, Tab, TabList, TabPanel } from "../../components/Tabs/index.js";
+ import { dialogs } from "../../../svelte-dialogs.config.js";
+ import { BenutzerClient } from "#components/Ausweis/types.js";
+ import { exclude } from "#lib/exclude.js";
+ import { api } from "astro-typesafe-api/client";
+ import Cookies from "js-cookie";
+ import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants.js";
export let benutzer: BenutzerClient;
- let passwort: string | undefined = undefined;
- let passwortVerify: string | undefined = undefined;
+ let passwort: string = "";
+ let passwortVerify: string = "";
async function profilSpeichern(e: SubmitEvent) {
e.preventDefault()
- if (!passwort) {
- passwort = undefined
- } else {
- if (passwort.length < 8) {
- dialogs.alert({
- title: "Passwort zu kurz",
- text: "Das Passwort muss mindestens 8 Zeichen lang sein.",
- })
- return
- } else if (passwort !== passwortVerify) {
- dialogs.alert({
- title: "Passwörter stimmen nicht überein",
- text: "Die eingegebenen Passwörter stimmen nicht überein.",
- })
- return
- }
+ if (passwort.length < 8) {
+ dialogs.alert({
+ title: "Passwort zu kurz",
+ text: "Das Passwort muss mindestens 8 Zeichen lang sein.",
+ })
+ return
+ } else if (passwort !== passwortVerify) {
+ dialogs.alert({
+ title: "Passwörter stimmen nicht überein",
+ text: "Die eingegebenen Passwörter stimmen nicht überein.",
+ })
+ return
}
const response = await dialogs.confirm({
@@ -51,7 +49,11 @@
// Wir wollen die Rolle nicht mit übertragen.
// Diese wird zwar sowieso rausgeschmissen aber sonst kommen wir nicht durch die Validation durch...
- await client.v1.benutzer.update.mutate(benutzerObjekt)
+ await api.user.POST.fetch(benutzerObjekt, {
+ headers: {
+ Authorization: `Bearer ${Cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)}`
+ }
+ })
dialogs.success({
title: "Profil gespeichert",
@@ -175,7 +177,7 @@
}
:global(.tab) {
- @apply rounded-none px-8 justify-start outline-0 gap-4 items-center text-base font-normal text-base-content;
+ @apply flex flex-row py-4 rounded-none px-8 justify-start outline-0 gap-4 items-center text-base font-normal text-base-content;
}
:global(.tab:hover) {
diff --git a/src/modules/Dashboard/DashboardModule.svelte b/src/modules/Dashboard/DashboardModule.svelte
index df294e80..fdda7618 100644
--- a/src/modules/Dashboard/DashboardModule.svelte
+++ b/src/modules/Dashboard/DashboardModule.svelte
@@ -1,24 +1,121 @@
Gebäudeübersicht
-
+
-
-
+
+
-
- {#each objekte as objekt}
+
+ {#each objekte as objekt}
{/each}
-
\ No newline at end of file
+
+
+
+
+
Gebäude erstellen
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/modules/KundendatenModule.svelte b/src/modules/KundendatenModule.svelte
index 022b9a1c..d30c1c54 100644
--- a/src/modules/KundendatenModule.svelte
+++ b/src/modules/KundendatenModule.svelte
@@ -116,29 +116,6 @@
`/angebot-anfragen/bedarfsausweis-gewerbe-anfragen?uid=${ausweis.uid}`,
}[ausweisart];
- async function speichern(e: SubmitEvent) {
- e.preventDefault();
-
- // Um einen Ausweis zu speichern müssen wir eingeloggt sein, andernfalls wird die API den call ablehnen.
- // Wir prüfen also ob wir eingeloggt sind und leiten den Nutzer ggf. auf die Login Seite weiter.
- if (!(await validateAccessTokenClient())) {
- // TOOD: Auf Dialog umstellen.
- const loggedIn = await dialogs.modal(LoginDialog);
-
- if (!loggedIn) {
- return false;
- }
- }
-
- // Falls der Ausweis noch keine benutzer_id hat müssen wir ihn claimen, damit er dem jetzigen Nutzer zugewiesen wird...
- // await client.v1.verbrauchsausweisWohnen.claim.mutate({
- // uid: ausweis.uid,
- // });
-
- localStorage.clear();
- window.location.href = `/kaufabschluss?uid=${ausweis.uid}`;
- }
-
async function anfordern() {
if (!form.checkValidity()) {
addNotification({
@@ -210,6 +187,34 @@
}
}
+ async function speichern() {
+ loginAction = speichern;
+ if (!await validateAccessTokenClient()) {
+ loginOverlayHidden = false;
+ return
+ }
+
+ loginOverlayHidden = true
+
+ let result: Awaited
> | null = null;
+ if (ausweisart === Enums.Ausweisart.GEGNachweisWohnen || ausweisart === Enums.Ausweisart.GEGNachweisGewerbe || ausweisart === Enums.Ausweisart.GEGNachweisBedarfsausweis) {
+ result = await nachweisSpeichern(ausweis, objekt, aufnahme, bilder, unterlagen, ausweisart)
+ } else {
+ result = await ausweisSpeichern(ausweis, objekt, aufnahme, bilder, ausweisart)
+ }
+
+ if (result !== null) {
+ window.history.pushState(
+ {},
+ "",
+ `${location.pathname}?uid=${ausweis.uid}`
+ );
+
+ localStorage.clear()
+ window.location.href = `/speichern-erfolgreich?uid=${ausweis.uid}`
+ }
+ }
+
async function bestellen() {
if (!form.checkValidity()) {
addNotification({
@@ -223,9 +228,9 @@
}
if (!await validateAccessTokenClient()) {
- loginAction = bestellen
- rechnung = rechnung
- loginOverlayHidden = false;
+ loginAction = bestellen
+ rechnung = rechnung
+ loginOverlayHidden = false;
return
}
@@ -498,7 +503,7 @@ sm:grid-cols-[min-content_min-content_min-content] sm:justify-self-end sm:mt-8"
-
+
{#if gegAnfrage}
-
+
-