refactor(utils): saveLineData entfernt und durch Redux-Thunk ersetzt

- updatePolylineCoordinatesThunk in markerUtils.js und poiUtils.js eingebunden
- zentrale Hilfsfunktion savePolylineRedux erstellt
- fetch() entfernt, Version auf 1.1.183 erhöht
This commit is contained in:
ISA
2025-05-27 08:33:02 +02:00
parent 44cb27ce0f
commit 4c6386edea
9 changed files with 157 additions and 212 deletions

View File

@@ -1,31 +1,6 @@
// /utils/mapUtils.js
import L from "leaflet";
export const saveLineData = (lineData) => {
fetch("/api/talas_v5_DB/gisLines/updateLineCoordinates", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
idModul: lineData.idModul,
idLD: lineData.idLD,
newCoordinates: lineData.coordinates,
}),
})
.then((response) => {
if (!response.ok) {
throw new Error("Fehler beim Speichern der Linienänderungen");
}
return response.json();
})
.then((data) => {
//console.log("Linienänderungen gespeichert:", data);
})
.catch((error) => {
console.error("Fehler beim Speichern der Linienänderungen:", error);
});
};
// Call this function on page load to restore zoom and center
export const restoreMapSettings = (map) => {
const savedZoom = localStorage.getItem("mapZoom");