refactor: POI aktualisieren auf updatePoiThunk + ID aus react-select umgestellt

- Thunk getDeviceIdByNameThunk entfernt
- idLD direkt aus Dropdown gelesen
- updatePoiThunk + updatePoiService vollständig eingebunden
- Fehlerbehandlung in handleSubmit verbessert
- Version erhöht auf 1.1.162
This commit is contained in:
Ismail Ali
2025-05-24 09:18:34 +02:00
parent b69a3efae3
commit fc6a706769
7 changed files with 98 additions and 24 deletions

View File

@@ -0,0 +1,12 @@
// /redux/thunks/database/getDeviceIdByNameThunk.js
import { createAsyncThunk } from "@reduxjs/toolkit";
import { getDeviceIdByNameService } from "../../../services/database/getDeviceIdByNameService";
export const getDeviceIdByNameThunk = createAsyncThunk("devices/getIdByName", async (deviceName, thunkAPI) => {
try {
return await getDeviceIdByNameService(deviceName);
} catch (error) {
return thunkAPI.rejectWithValue(error.message);
}
});

View File

@@ -0,0 +1,12 @@
// /redux/thunks/database/updatePoiThunk.js
import { createAsyncThunk } from "@reduxjs/toolkit";
import { updatePoiService } from "../../../services/database/updatePoiService";
export const updatePoiThunk = createAsyncThunk("pois/update", async (poi, thunkAPI) => {
try {
await updatePoiService(poi);
} catch (error) {
return thunkAPI.rejectWithValue(error.message);
}
});