Files
nodeMap/services/database/area/updateAreaService.js
ISA 44cb27ce0f refactor(area): Bereichsaktualisierung von util auf Redux umgestellt
- updateAreaUtil.js entfernt
- updateAreaService, updateAreaThunk, updateAreaSlice eingeführt
- useAreaMarkersLayer nutzt jetzt updateAreaThunk
- MapComponent umgestellt auf Redux-Dispatch
- Version erhöht auf 1.1.182
2025-05-27 07:55:12 +02:00

24 lines
579 B
JavaScript

// /services/database/area/updateAreaService.js
export const updateAreaService = async ({ idLocation, idMap, newCoords }) => {
const response = await fetch("/api/talas_v5_DB/area/updateArea", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
idLocation,
idMap,
x: newCoords.x,
y: newCoords.y,
}),
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.message || "Fehler beim Aktualisieren der Fläche");
}
return await response.json();
};