Alle TDM und TDR in Mock speichern
This commit is contained in:
@@ -2,14 +2,13 @@
|
||||
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchTDMDataBySlot } from "../../services/fetchSingleTDMData";
|
||||
import { setLoopMeasurementCurveChartData } from "../slices/kabelueberwachungChartSlice";
|
||||
|
||||
export const fetchTDMDataBySlotThunk = createAsyncThunk(
|
||||
"tdmChart/fetchSlotData",
|
||||
async (slot: number, { dispatch }) => {
|
||||
"tdmSingleChart/fetchSlotData",
|
||||
async (slot: number) => {
|
||||
const data = await fetchTDMDataBySlot(slot);
|
||||
if (data) {
|
||||
dispatch(setLoopMeasurementCurveChartData(data));
|
||||
}
|
||||
if (!data) throw new Error("Keine TDM-Daten für diesen Slot gefunden");
|
||||
|
||||
return { slot, data }; // ✅ das erwartet der Slice!
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user