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

@@ -4,9 +4,9 @@ import React, { useState, useEffect } from "react";
import { useSelector } from "react-redux";
import { useAppDispatch } from "../../../../../../redux/store";
import { RootState } from "../../../../../../redux/store";
import { fetchTDMDataBySlotThunk } from "../../../../../../redux/thunks/fetchTDMListBySlotThunk";
import { fetchTDRChartDataByIdThunk } from "../../../../../../redux/thunks/fetchTDRChartDataByIdThunk";
import { fetchReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/fetchReferenceCurveBySlotThunk"; // ⬅ import ergänzen
import { fetchTDMDataBySlotThunk } from "../../../../../../redux/thunks/getTDMListBySlotThunk";
import { getTDRChartDataByIdThunk } from "../../../../../../redux/thunks/getTDRChartDataByIdThunk";
import { getReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/getReferenceCurveBySlotThunk"; // ⬅ import ergänzen
const TDRChartActionBar: React.FC = () => {
const dispatch = useAppDispatch();
@@ -33,7 +33,7 @@ const TDRChartActionBar: React.FC = () => {
const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
const id = parseInt(e.target.value);
setSelectedId(id);
dispatch(fetchTDRChartDataByIdThunk(id));
dispatch(getTDRChartDataByIdThunk(id));
};
// 📌 Referenz setzen (nutzt Slotnummer + 1 für die API)
@@ -79,7 +79,7 @@ const TDRChartActionBar: React.FC = () => {
JSON.stringify(currentChartData)
);
dispatch(fetchReferenceCurveBySlotThunk(selectedSlot));
dispatch(getReferenceCurveBySlotThunk(selectedSlot));
alert("Referenzkurve wurde erfolgreich gesetzt!");
} catch (error) {
@@ -96,7 +96,7 @@ const TDRChartActionBar: React.FC = () => {
if (slotData?.length > 0) {
const lastId = slotData[0].id;
setSelectedId(lastId);
dispatch(fetchTDRChartDataByIdThunk(lastId));
dispatch(getTDRChartDataByIdThunk(lastId));
}
});
}