chore: fetch to get in redux thunks files name
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
setSelectedChartType,
|
||||
} from "../../../../../redux/slices/tdrChartSlice";
|
||||
import { resetBrushRange } from "../../../../../redux/slices/brushSlice";
|
||||
import { fetchTDMDataBySlotThunk } from "../../../../../redux/thunks/fetchTDMListBySlotThunk";
|
||||
import { fetchTDMDataBySlotThunk } from "../../../../../redux/thunks/getTDMListBySlotThunk";
|
||||
import { useLoopChartLoader } from "./LoopMeasurementChart/LoopChartActionBar";
|
||||
|
||||
import {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Chart, registerables } from "chart.js";
|
||||
import "chartjs-adapter-date-fns";
|
||||
import { getColor } from "../../../../../../utils/colors";
|
||||
import TDRChartActionBar from "./TDRChartActionBar";
|
||||
import { fetchReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/fetchReferenceCurveBySlotThunk";
|
||||
import { getReferenceCurveBySlotThunk } from "../../../../../../redux/thunks/getReferenceCurveBySlotThunk";
|
||||
|
||||
const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
@@ -52,7 +52,7 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
|
||||
//--------------------------------
|
||||
useEffect(() => {
|
||||
if (selectedSlot !== null) {
|
||||
dispatch(fetchReferenceCurveBySlotThunk(selectedSlot));
|
||||
dispatch(getReferenceCurveBySlotThunk(selectedSlot));
|
||||
}
|
||||
}, [selectedSlot, dispatch]);
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user