refactor(polylines): fetch-Aufruf in setupPolylines durch Redux-Thunk ersetzt
- updatePolylineCoordinatesThunk verwendet - Service-Architektur mit Redux Toolkit umgesetzt - fetch entfernt, Version auf 1.1.181 erhöht
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// /services/database/polylines/updatePolylineCoordinatesService.js
|
||||
|
||||
export const updatePolylineCoordinatesService = async (data) => {
|
||||
const response = await fetch("/api/talas_v5_DB/gisLines/updateLineCoordinates", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const error = await response.json();
|
||||
throw new Error(error.error || "Fehler beim Aktualisieren der Polyline-Koordinaten");
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
};
|
||||
Reference in New Issue
Block a user