chore: fetch to get in redux thunks files name

This commit is contained in:
Ismail Ali
2025-06-21 10:15:05 +02:00
parent dd76665848
commit 7740806952
42 changed files with 144 additions and 126 deletions

View File

@@ -0,0 +1,14 @@
// /redux/thunks/fetchTDMDataBySlotThunk.ts
import { createAsyncThunk } from "@reduxjs/toolkit";
import { fetchSingleTDMDataService } from "../../services/fetchSingleTDMDataService";
export const fetchTDMDataBySlotThunk = createAsyncThunk(
"tdmSingleChart/fetchSlotData",
async (slot: number) => {
const data = await fetchSingleTDMDataService(slot);
if (!data) throw new Error("Keine TDM-Daten für diesen Slot gefunden");
return { slot, data }; // ✅ das erwartet der Slice!
}
);