- 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
43 lines
978 B
JavaScript
43 lines
978 B
JavaScript
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.");
|
|
}
|
|
}
|
|
};
|