feat: POI-Erstellung, -Bearbeitung und -Löschung vollständig überarbeitet
- POI-Tooltip zeigt jetzt den korrekten Gerätenamen aus Redux (gisStationsStaticDistrict) - Bearbeitungsmodal (PoiUpdateModal) verwendet Redux-Daten (idLD → Gerätelabel) zur Initialisierung - Fix: Geräte-Dropdown im Modal zeigt nun den ausgewählten POI korrekt an - Refactor: `handleUpdatePoi()` nutzt `description` statt `name` - Fehlerbehandlung im Modal verbessert (alert bei leerem Feld, besseres Logging) - Redux-Thunk `updatePoiThunk` + `updatePoiService` stabilisiert - Map aktualisiert POIs nach Bearbeitung automatisch 📦 Version erhöht auf 1.1.253 🗓️ 11.06.2025
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
// @/components/pois/poiUpdateModal/utils/handlers.js
|
||||
import { updatePoiThunk } from "@/redux/thunks/database/pois/updatePoiThunk";
|
||||
import { deletePoiThunk } from "@/redux/thunks/database/pois/deletePoiThunk";
|
||||
|
||||
export const handleSubmit = async ({
|
||||
event,
|
||||
dispatch,
|
||||
poiId,
|
||||
name,
|
||||
description,
|
||||
poiTypeId,
|
||||
deviceName,
|
||||
@@ -10,16 +13,18 @@ export const handleSubmit = async ({
|
||||
onClose,
|
||||
}) => {
|
||||
event.preventDefault();
|
||||
const payload = {
|
||||
idPoi: poiId,
|
||||
name: description, // 💡 <- Das ist die entscheidende Änderung!
|
||||
description,
|
||||
idPoiTyp: poiTypeId?.value ?? poi?.idPoiTyp,
|
||||
idLD: deviceName?.value,
|
||||
};
|
||||
|
||||
console.log("🔍 POI Update Payload:", payload);
|
||||
|
||||
try {
|
||||
await dispatch(
|
||||
updatePoiThunk({
|
||||
idPoi: poiId,
|
||||
name,
|
||||
description,
|
||||
idPoiTyp: poiTypeId?.value ?? poi?.idPoiTyp,
|
||||
idLD: deviceName?.value,
|
||||
})
|
||||
).unwrap();
|
||||
await dispatch(updatePoiThunk(payload)).unwrap();
|
||||
onClose();
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user