git commit -m "fix: Fehlerbehandlung für fehlende gis_lines-Tabelle und Verwendung des DB-Namens aus .env
- Verhindert Absturz der Anwendung, wenn die gis_lines-Tabelle fehlt - Gibt stattdessen eine Warnung in der Konsole aus - Stellt sicher, dass der Datenbankname dynamisch aus der .env-Datei geladen wird"
This commit is contained in:
@@ -20,6 +20,11 @@ const useLineData = (webserviceGisLinesStatusUrl, setLineStatusData) => {
|
||||
const response2 = await fetch(`${SERVER_URL}:3000/api/talas_v5_DB/gisLines/readGisLines`);
|
||||
const data2 = await response2.json();
|
||||
|
||||
if (!Array.isArray(data2)) {
|
||||
console.warn("gis_lines Daten sind nicht in der erwarteten Form. Wird ignoriert.");
|
||||
return;
|
||||
}
|
||||
|
||||
const response3 = await fetch(`${SERVER_URL}:3000/api/talas_v5_DB/device/getAllStationsNames`);
|
||||
const namesData = await response3.json();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user