API Verbessert - Verbrauchsausweis Funktioniert
This commit is contained in:
@@ -15,13 +15,14 @@
|
||||
import { auditBedarfsausweisBenoetigt } from "#components/Verbrauchsausweis/audits/BedarfsausweisBenoetigt";
|
||||
import { auditVerbrauchAbweichung } from "#components/Verbrauchsausweis/audits/VerbrauchAbweichung";
|
||||
import { GebaeudeStammdaten, VerbrauchsausweisWohnen } from "@ibcornelsen/database";
|
||||
import trpc from "src/trpc";
|
||||
import { client } from "src/trpc";
|
||||
|
||||
export let uid: string = "";
|
||||
|
||||
let gebaeude: GebaeudeStammdaten = {} as GebaeudeStammdaten;
|
||||
let ausweis: VerbrauchsausweisWohnen = {} as VerbrauchsausweisWohnen;
|
||||
if (uid) {
|
||||
// NOTE: Funktioniert nicht mehr
|
||||
async () => {
|
||||
const result = await fetch(`/api/verbrauchsausweis?uid=${uid}`, {
|
||||
method: "GET",
|
||||
@@ -62,11 +63,16 @@
|
||||
|
||||
|
||||
async function ausweisAbschicken() {
|
||||
console.log(ausweis);
|
||||
|
||||
overlay.ariaHidden = "false";
|
||||
const response = await trpc.v1.verbrauchsausweisWohnen[2016].erstellen.mutate({
|
||||
const response = await client.v1.verbrauchsausweisWohnen[2016].erstellen.mutate({
|
||||
...ausweis,
|
||||
gebaeude_stammdaten: gebaeude
|
||||
})
|
||||
|
||||
console.log(response.uid);
|
||||
|
||||
}
|
||||
|
||||
let overlay: HTMLDivElement;
|
||||
|
||||
Reference in New Issue
Block a user