refactor: POI-Daten vollständig in Redux integriert
- useFetchPoiData.js entfernt - Neue Redux-Slices für POI-Typen und POI-Icons erstellt - Neue Services und Thunks hinzugefügt - fetch-Aufrufe durch zentralisierte Redux-Logik ersetzt - store.js aktualisiert und neue States registriert
This commit is contained in:
11
redux/thunks/database/fetchPoiTypThunk.js
Normal file
11
redux/thunks/database/fetchPoiTypThunk.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// /redux/thunks/database/fetchPoiTypThunk.js
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchPoiTypService } from "../../../services/database/fetchPoiTypService";
|
||||
|
||||
export const fetchPoiTypThunk = createAsyncThunk("poiTyp/fetch", async (_, thunkAPI) => {
|
||||
try {
|
||||
return await fetchPoiTypService();
|
||||
} catch (err) {
|
||||
return thunkAPI.rejectWithValue(err.message);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user