feat: Geräteauswahl und Anzeige beim POI-Handling auf WebService umgestellt
- setupPOIs.js angepasst: Gerätedaten (LD_Name) aus GisStationsStaticDistrict verwendet - MapComponent.js übergibt WebService-Geräte (`Points`) als gisDevices an setupPOIs - PoiUpdateModal.js nutzt LD_Name für react-select Dropdown statt name aus DB - Dropdown-Anzeige und Tooltip-Daten für POIs nun konsistent mit WebService-Geräteliste
This commit is contained in:
42
components/pois/poiUpdateModal/utils/handlers.js
Normal file
42
components/pois/poiUpdateModal/utils/handlers.js
Normal file
@@ -0,0 +1,42 @@
|
||||
export const handleSubmit = async ({
|
||||
event,
|
||||
dispatch,
|
||||
poiId,
|
||||
name,
|
||||
description,
|
||||
poiTypeId,
|
||||
deviceName,
|
||||
poi,
|
||||
onClose,
|
||||
}) => {
|
||||
event.preventDefault();
|
||||
try {
|
||||
await dispatch(
|
||||
updatePoiThunk({
|
||||
idPoi: poiId,
|
||||
name,
|
||||
description,
|
||||
idPoiTyp: poiTypeId?.value ?? poi?.idPoiTyp,
|
||||
idLD: deviceName?.value,
|
||||
})
|
||||
).unwrap();
|
||||
onClose();
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Aktualisieren des POI:", error);
|
||||
alert("Fehler beim Aktualisieren des POI.");
|
||||
}
|
||||
};
|
||||
|
||||
export const handleDeletePoi = async ({ dispatch, poiId, onClose }) => {
|
||||
if (confirm("Sind Sie sicher, dass Sie diesen POI löschen möchten?")) {
|
||||
try {
|
||||
await dispatch(deletePoiThunk(poiId)).unwrap();
|
||||
onClose();
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Löschen des POI:", error);
|
||||
alert("Fehler beim Löschen des POI.");
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user