refactor: Services nach Datenquelle getrennt – webservice/, database/ und utils/ Struktur eingeführt (v1.1.117)

This commit is contained in:
ISA
2025-05-20 13:27:20 +02:00
parent e3b8f7f0fc
commit 2846bc0b13
17 changed files with 29 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
// /services/api/fetchGisSystemStatic.js
export const fetchGisSystemStatic = async (url, setGisSystemStatic, setGisSystemStaticLoaded) => {
try {
const response = await fetch(url);
const jsonResponse = await response.json();
if (jsonResponse && jsonResponse.Systems) {
setGisSystemStatic(jsonResponse.Systems);
setGisSystemStaticLoaded(true);
} else {
console.error('Erwartete Daten im "Systems"-Array nicht gefunden', jsonResponse);
setGisSystemStatic([]);
}
} catch (error) {
console.error("Fehler beim Laden der Daten: ", error);
setGisSystemStatic([]);
}
};