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:
12
redux/thunks/database/getDeviceIdByNameThunk.js
Normal file
12
redux/thunks/database/getDeviceIdByNameThunk.js
Normal 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);
|
||||
}
|
||||
});
|
||||
12
redux/thunks/database/updatePoiThunk.js
Normal file
12
redux/thunks/database/updatePoiThunk.js
Normal 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);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user