refactor: TDR-Daten in neuen tdrSingleChartSlice ausgelagert und nur pro Slot geladen

- Globalen fetchAllTDRChartData entfernt
- Neuen Slice und Thunk pro Slot erstellt
- TDRChart liest initiale Daten aus neuem Slice
This commit is contained in:
ISA
2025-03-27 14:55:06 +01:00
parent c91d621186
commit 4e459a7f36
9 changed files with 146 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
// /redux/thunks/fetchTDRChartDataBySlotThunk.ts
import { createAsyncThunk } from "@reduxjs/toolkit";
import { fetchTDRChartDataBySlot } from "../../services/fetchSingleTDRChartData";
export const fetchTDRChartDataBySlotThunk = createAsyncThunk(
"tdrChart/fetchSlotData",
async (slot: number) => {
const data = await fetchTDRChartDataBySlot(slot);
if (!data) throw new Error(`Daten für Slot ${slot} nicht gefunden`);
return { slot, data };
}
);