TDR Chart von Dropdown Menü Auwahl zeichnen

This commit is contained in:
ISA
2025-03-24 15:00:20 +01:00
parent 69bcbf519d
commit 68614df0cd
14 changed files with 13428 additions and 152 deletions

View File

@@ -0,0 +1,22 @@
// /services/fetchTDRChartDataById.ts
export const fetchTDRChartDataById = async (
id: number
): Promise<any[] | null> => {
const isDev = process.env.NODE_ENV === "development";
const url = isDev
? `http://localhost:3000/CPLmockData/Last100TDR/kue_01/id/${id}.json`
: `${window.location.origin}/CPL?Service/empty.acp&TDR=${id}`;
try {
const response = await fetch(url);
if (!response.ok)
throw new Error(`Fehler beim Laden der TDR-Daten für ID ${id}`);
return await response.json();
} catch (error) {
console.error("❌ Fehler in fetchTDRChartDataById:", error);
return null;
}
};