Letzte TDR-Messung anzeigen für ausgewählte Slot
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// /redux/thunks/fetchTDMDataBySlotThunk.ts
|
||||
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchTDMDataBySlot } from "../../services/fetchSingleTDMData";
|
||||
import { fetchTDMDataBySlot } from "../../services/fetchTDMListBySlot";
|
||||
|
||||
export const fetchTDMDataBySlotThunk = createAsyncThunk(
|
||||
"tdmSingleChart/fetchSlotData",
|
||||
12
redux/thunks/fetchTDRChartDataByIdThunk.ts
Normal file
12
redux/thunks/fetchTDRChartDataByIdThunk.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// /redux/thunks/fetchTDRChartDataByIdThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchTDRChartDataById } from "../../services/fetchTDRChartDataById";
|
||||
|
||||
export const fetchTDRChartDataByIdThunk = createAsyncThunk(
|
||||
"tdrDataById/fetchById",
|
||||
async (id: number) => {
|
||||
const data = await fetchTDRChartDataById(id);
|
||||
if (!data) throw new Error(`Keine TDR-Daten für ID ${id}`);
|
||||
return { id, data };
|
||||
}
|
||||
);
|
||||
@@ -1,13 +0,0 @@
|
||||
// /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 };
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user