Fehler gefixt die beim Testen aufgefallen sind.

This commit is contained in:
Moritz Utcke
2025-02-17 11:24:07 +07:00
parent 74f05d404c
commit 5f8d30a5a3
17 changed files with 116 additions and 103 deletions

View File

@@ -1,20 +1,29 @@
import { ObjektClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js";
import {
ObjektClient,
VerbrauchsausweisWohnenClient,
} from "#components/Ausweis/types.js";
import { AuditType, hidden } from "./hidden.js";
import { getKlimafaktoren } from "#lib/Klimafaktoren.js";
export async function auditKlimaFaktoren(ausweis: VerbrauchsausweisWohnenClient, gebaeude: ObjektClient): Promise<boolean> {
export async function auditKlimaFaktoren(
ausweis: VerbrauchsausweisWohnenClient,
gebaeude: ObjektClient
): Promise<boolean> {
if (hidden.has(AuditType.KLIMA_FAKTOREN)) {
return false;
}
if (ausweis.startdatum && gebaeude.plz && ausweis.verbrauch_1) {
try {
const response = await getKlimafaktoren(ausweis.startdatum, gebaeude.plz);
return true; // Alle Klimfaktoren konnten abgefragt werden.
} catch (e) {
return true;
if (ausweis.startdatum && gebaeude.plz && ausweis.verbrauch_1) {
try {
const response = await getKlimafaktoren(
ausweis.startdatum,
gebaeude.plz
);
return true; // Alle Klimfaktoren konnten abgefragt werden.
} catch (e) {
return true;
}
}
}
return false;
return false;
}