cleanup: alte GIS-Fetch-Dateien und unnötige Service-Imports entfernt – vollständige Umstellung auf zentrale Thunks abgeschlossen

This commit is contained in:
ISA
2025-05-21 10:41:59 +02:00
parent 86f1c1feb0
commit 0b7704935f
19 changed files with 110 additions and 31 deletions

View File

@@ -0,0 +1,31 @@
// /redux/slices/database/locationDevicesSlice.js
import { createSlice } from "@reduxjs/toolkit";
import { fetchLocationDevicesThunk } from "../../../thunks/fetchLocationDevicesThunk";
const slice = createSlice({
name: "locationDevices",
initialState: {
data: [],
status: "idle",
error: null,
},
reducers: {},
extraReducers: (builder) => {
builder
.addCase(fetchLocationDevicesThunk.pending, (state) => {
state.status = "loading";
})
.addCase(fetchLocationDevicesThunk.fulfilled, (state, action) => {
state.status = "succeeded";
state.data = action.payload;
})
.addCase(fetchLocationDevicesThunk.rejected, (state, action) => {
state.status = "failed";
state.error = action.error.message;
});
},
});
export default slice.reducer;
export const selectLocationDevices = (state) => state.locationDevices.data;