Ausweis Speichern und Startmonat

This commit is contained in:
Moritz Utcke
2024-12-20 14:44:10 +07:00
parent 06f9b3dc49
commit f89c5e1271
2 changed files with 34 additions and 51 deletions

View File

@@ -65,8 +65,8 @@
fuelMap[fuel[0]].push(fuel[1]);
}
let month = ausweis.startdatum?.getMonth() || null;
let year = ausweis.startdatum?.getFullYear() || null;
let month = ausweis.startdatum?.getMonth();
let year = ausweis.startdatum?.getFullYear();
$: {
if (typeof month === "number" && typeof year === "number") {
@@ -158,11 +158,11 @@ xl:grid-cols-3 xl:gap-x-8 xl:gap-y-8
{#each Array.from(availableDates.reduce((a, c) => {
a.add(c.month);
return a;
}, new Set())) as month}
}, new Set())) as availableMonth}
<option
value={month}
selected={ausweis.startdatum?.getMonth() === month}
>{monthNames[month]}</option
value={availableMonth}
selected={month === availableMonth}
>{monthNames[availableMonth]}</option
>
{/each}
{/if}

View File

@@ -68,22 +68,6 @@
loginOverlayHidden = true;
if (ausweis.uid) {
// Anscheinend wurde der Ausweis bereits erstellt und hat eine UID.
// Jetzt müssen wir ihn nun nur noch abspeichern.
try {
await client.v1.verbrauchsausweisWohnen[2016].speichern.mutate({
ausweis,
gebaeude
})
await bilderHochladen();
return true;
} catch (e) {
// TODO: Ticket mit Fehldermeldung abschicken.
}
} else {
// Wir speichern den Ausweis ab und leiten auf die "ausweis-gespeichert" Seite weiter.
try {
const response = await verbrauchsausweisWohnenSpeichern(ausweis,
@@ -116,7 +100,6 @@
})
// TODO: Ticket mit Fehldermeldung abschicken.
}
}
addNotification({
dismissable: false,