- updateAreaUtil.js entfernt - updateAreaService, updateAreaThunk, updateAreaSlice eingeführt - useAreaMarkersLayer nutzt jetzt updateAreaThunk - MapComponent umgestellt auf Redux-Dispatch - Version erhöht auf 1.1.182
24 lines
579 B
JavaScript
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();
|
|
};
|