feat: Geräte-Daten aus Redux-Store in POI-Bearbeiten-Modal integriert

- Geräte-Liste wird jetzt direkt aus dem Redux-Store (locationDevicesFromDB) verwendet.
- Dropdown-Menü zeigt alle verfügbaren Geräte aus der Datenbank.
- Beim Öffnen des Modals wird der vorher zugewiesene Gerätname automatisch ausgewählt (Pre-Selection).
- Cleanup und Optimierung: Keine separaten API-Calls mehr im Modal.
- Struktur verbessert durch Auslagerung der Lade-Logik in useInitLocationDevices Hook.
This commit is contained in:
Ismail Ali
2025-03-07 20:52:00 +01:00
parent 5a27bc5d75
commit c57ae7717a
11 changed files with 145 additions and 97 deletions

View File

@@ -0,0 +1,8 @@
// /redux/api/fromDB/locationDevicesLoader.js
export const fetchLocationDevices = async () => {
const response = await fetch("/api/talas_v5_DB/locationDevice/locationDevices");
if (!response.ok) {
throw new Error("Geräteliste konnte nicht geladen werden");
}
return await response.json();
};

View File