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
This commit is contained in:
23
services/database/area/updateAreaService.js
Normal file
23
services/database/area/updateAreaService.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// /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();
|
||||
};
|
||||
Reference in New Issue
Block a user