chore: fetch to get in redux thunks files name
This commit is contained in:
@@ -6,5 +6,5 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||
NEXT_PUBLIC_USE_CGI=false
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.437
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.438
|
||||
NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||
NEXT_PUBLIC_USE_CGI=true
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.437
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.438
|
||||
NEXT_PUBLIC_CPL_MODE=production
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,38 +1,50 @@
|
||||
## [1.6.438] – 2025-06-21
|
||||
|
||||
- chore(tsconfig): fix moduleResolution and path aliases for Next.js project
|
||||
|
||||
---
|
||||
## [1.6.437] – 2025-06-21
|
||||
|
||||
- chore: rename service/thunk files to follow get/fetch naming convention
|
||||
|
||||
---
|
||||
|
||||
## [1.6.436] – 2025-06-20
|
||||
|
||||
- Mocks erstellt für API für Entwicklungsumgebung
|
||||
|
||||
---
|
||||
|
||||
## [1.6.435] – 2025-06-20
|
||||
|
||||
- auto CHANGELOG.md
|
||||
|
||||
---
|
||||
|
||||
## [1.6.434] – 2025-06-20
|
||||
|
||||
- pre-commit
|
||||
|
||||
---
|
||||
|
||||
## [1.6.433] – 2025-06-20
|
||||
|
||||
- CHANGELOG auto
|
||||
|
||||
---
|
||||
|
||||
## [1.6.432] – 2025-06-20
|
||||
|
||||
- feat: Statusanzeige für Eingänge implementiert
|
||||
|
||||
---
|
||||
|
||||
## [1.6.431] – 2025-06-20
|
||||
|
||||
- feat: Digitale & analoge Eingänge in allen Modi (json/jsmock/production) vollständig implementiert
|
||||
|
||||
---
|
||||
|
||||
# 📦 CHANGELOG – CPLv4.0
|
||||
|
||||
Alle Änderungen und Versionen des CPLv4.0 Frontends chronologisch dokumentiert.
|
||||
@@ -145,7 +157,7 @@ Scahlter für Ein/Aus muss noch im Backend programmiert werden
|
||||
|
||||
- In `_app.tsx` wurde ein zentrales Redux-Update-System implementiert:
|
||||
- Die aktuelle Seite wird automatisch erkannt (`window.location.pathname`)
|
||||
- Abhängig von der Seite werden die passenden Thunks geladen (z. B. `fetchKueDataThunk`, `fetchDigitalOutputsThunk` usw.)
|
||||
- Abhängig von der Seite werden die passenden Thunks geladen (z. B. `getKueDataThunk`, `getDigitalOutputsThunk` usw.)
|
||||
- Die Daten werden alle 10 Sekunden erneut geladen
|
||||
- Dadurch muss auf den Unterseiten kein separater Redux-Aufruf mehr erfolgen
|
||||
- Unterstützt alle Slices: digitale/analoge Ein- und Ausgänge, Meldungen, Systemstatus, Einstellungen, TDR/Loop-Daten
|
||||
|
||||
14
README.md
14
README.md
@@ -298,22 +298,22 @@ npm run build
|
||||
|
||||
| Thunk Name | Zweck |
|
||||
| :-------------------------------------- | :-------------------------------------- |
|
||||
| `fetchSystemVoltTempThunk` | Lade Systemspannungen und Temperaturen |
|
||||
| `fetchDigitalOutputsThunk` | Lade Status der digitalen Ausgänge |
|
||||
| `fetchDigitalInputsThunk` | Lade Status der digitalen Eingänge |
|
||||
| `getSystemVoltTempThunk` | Lade Systemspannungen und Temperaturen |
|
||||
| `getDigitalOutputsThunk` | Lade Status der digitalen Ausgänge |
|
||||
| `getDigitalInputsThunk` | Lade Status der digitalen Eingänge |
|
||||
| `fetchAnalogeEingaengeThunk` | Lade analoge Eingänge |
|
||||
| `fetchTDRChartDataThunk` | Lade TDR-Messkurve für einen Slot |
|
||||
| `fetchTDRReferenceChartThunk` | Lade TDR-Referenzkurve |
|
||||
| `fetchLoopChartDataThunk` | Lade Schleifen- und Isolationsmesswerte |
|
||||
| `fetchLast20MessagesThunk` | Lade letzte 20 Systemmeldungen |
|
||||
| `getLoopChartDataThunk` | Lade Schleifen- und Isolationsmesswerte |
|
||||
| `getLast20MessagesThunk` | Lade letzte 20 Systemmeldungen |
|
||||
| `fetchKabelueberwachungChartThunk` | Lade Visualisierungsdaten der Slots |
|
||||
| `fetchTDMChartThunk` | Lade TDM (Multiple TDR) Messungen |
|
||||
| `fetchTDRDataByIdThunk` | Lade TDR-Daten anhand einer ID |
|
||||
| `fetchTdmSingleChartThunk` | Lade Einzel-TDM-Messung |
|
||||
| `fetchSelectedChartDataThunk` | Lade selektierte Diagrammdaten |
|
||||
| `fetchTDRReferenceChartDataBySlotThunk` | Lade Referenzkurven pro Slot |
|
||||
| `fetchSystemSettingsThunk` | Lade Systemeinstellungen |
|
||||
| `fetchOpcuaSettingsThunk` | Lade OPC UA Einstellungen und Benutzer |
|
||||
| `getSystemSettingsThunk` | Lade Systemeinstellungen |
|
||||
| `getOpcUaSettingsThunk` | Lade OPC UA Einstellungen und Benutzer |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { RootState } from "@/redux/store";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { AppDispatch } from "@/redux/store";
|
||||
import decodeToken from "@/utils/decodeToken";
|
||||
import { fetchSystemSettingsThunk } from "@/redux/thunks/fetchSystemSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "@/redux/thunks/getSystemSettingsThunk";
|
||||
|
||||
function Header() {
|
||||
const router = useRouter();
|
||||
@@ -59,7 +59,7 @@ function Header() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!deviceName) {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
}
|
||||
}, [deviceName, dispatch]);
|
||||
//----------------------------------------------------------------
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { RootState, AppDispatch } from "@/redux/store";
|
||||
import { fetchAnalogInputsThunk } from "@/redux/thunks/fetchAnalogInputsThunk";
|
||||
import { getAnalogInputsThunk } from "@/redux/thunks/getAnalogInputsThunk";
|
||||
import { Icon } from "@iconify/react";
|
||||
import settingsIcon from "@iconify/icons-mdi/settings";
|
||||
import waveformIcon from "@iconify/icons-mdi/waveform";
|
||||
@@ -20,7 +20,7 @@ export default function AnalogInputsTable({
|
||||
const [activeId, setActiveId] = React.useState<number | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchAnalogInputsThunk());
|
||||
dispatch(getAnalogInputsThunk());
|
||||
}, [dispatch]);
|
||||
|
||||
const analogInputs = useSelector(
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useAdminAuth } from "./hooks/useAdminAuth";
|
||||
import handleAdminLogin from "./handlers/handleAdminLogin";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { AppDispatch } from "../../../redux/store";
|
||||
import { fetchSystemSettingsThunk } from "../../../redux/thunks/fetchSystemSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "../../../redux/thunks/getSystemSettingsThunk";
|
||||
import handleGeneralSubmit from "./handlers/handleGeneralSubmit";
|
||||
|
||||
const GeneralSettings: React.FC = () => {
|
||||
@@ -52,7 +52,7 @@ const GeneralSettings: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!systemSettings.deviceName) {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
}
|
||||
}, []);
|
||||
/*
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useSelector } from "react-redux";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RootState, useAppDispatch } from "../../../redux/store";
|
||||
import KabelModulStatus from "./modulesStatus/KabelModulStatus";
|
||||
import { fetchKueDataThunk } from "../../../redux/thunks/fetchKueDataThunk";
|
||||
import { getKueDataThunk } from "../../../redux/thunks/getKueDataThunk";
|
||||
|
||||
const Baugruppentraeger: React.FC = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
@@ -83,7 +83,7 @@ const Baugruppentraeger: React.FC = () => {
|
||||
}
|
||||
//--------------------------------------------
|
||||
useEffect(() => {
|
||||
dispatch(fetchKueDataThunk());
|
||||
dispatch(getKueDataThunk());
|
||||
}, [dispatch]);
|
||||
//--------------------------------------------
|
||||
return <>{baugruppen}</>;
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import { RootState, AppDispatch } from "../../../redux/store";
|
||||
import { fetchSystemSettingsThunk } from "../../../redux/thunks/fetchSystemSettingsThunk";
|
||||
import { fetchOpcUaSettingsThunk } from "../../../redux/thunks/fetchOpcUaSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "../../../redux/thunks/getSystemSettingsThunk";
|
||||
import { getOpcUaSettingsThunk } from "../../../redux/thunks/getOpcUaSettingsThunk";
|
||||
|
||||
const NetworkInfo: React.FC = () => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
|
||||
// ✅ OPC UA Daten laden, wenn Komponente angezeigt wird
|
||||
useEffect(() => {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(fetchOpcUaSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
dispatch(getOpcUaSettingsThunk());
|
||||
}, [dispatch]);
|
||||
// Werte direkt aus Redux holen
|
||||
const ip =
|
||||
|
||||
@@ -15,7 +15,7 @@ Dieses Dokument beschreibt die Architektur und Datenflüsse für das **Lesen** u
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[DigitalOutputsWidget.tsx] --> B[useEffect]
|
||||
B --> C[dispatch fetchDigitalOutputsThunk]
|
||||
B --> C[dispatch getDigitalOutputsThunk]
|
||||
C --> D[fetchDigitalOutputsService]
|
||||
D --> E{Moduswahl: NEXT_PUBLIC_CPL_MODE}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start([SystemPage geöffnet])
|
||||
Start --> DispatchThunk[Dispatch fetchSystemVoltTempThunk]
|
||||
Start --> DispatchThunk[Dispatch getSystemVoltTempThunk]
|
||||
DispatchThunk --> Service[fetchSystemVoltTempService lädt Daten]
|
||||
Service -->|Erfolg| ReduxStore[Redux Store aktualisiert]
|
||||
ReduxStore --> View[Anzeige der Werte und Charts]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
```mermaid
|
||||
flowchart LR
|
||||
User(User öffnet Seite)
|
||||
User --> DispatchThunk(fetchSystemVoltTempThunk)
|
||||
User --> DispatchThunk(getSystemVoltTempThunk)
|
||||
DispatchThunk --> ServiceCall(fetchSystemVoltTempService)
|
||||
ServiceCall --> API(API Handler / Mock Daten)
|
||||
API --> ScriptLoaded(Mock-Daten im window geladen)
|
||||
|
||||
@@ -10,7 +10,7 @@ sequenceDiagram
|
||||
participant MockData
|
||||
|
||||
User->>SystemPage: Öffnet System-Seite
|
||||
SystemPage->>ReduxStore: dispatch(fetchSystemVoltTempThunk)
|
||||
SystemPage->>ReduxStore: dispatch(getSystemVoltTempThunk)
|
||||
ReduxStore->>Service: fetchSystemVoltTempService()
|
||||
Service->>API: Anfrage an /api/cpl/systemVoltTempAPIHandler
|
||||
API->>MockData: Lese systemVoltTempMockData.js
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.437",
|
||||
"version": "1.6.438",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.437",
|
||||
"version": "1.6.438",
|
||||
"dependencies": {
|
||||
"@fontsource/roboto": "^5.1.0",
|
||||
"@iconify-icons/ri": "^1.2.10",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.437",
|
||||
"version": "1.6.438",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -3,29 +3,29 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { Provider } from "react-redux";
|
||||
import store, { useAppDispatch } from "../redux/store";
|
||||
import store, { useAppDispatch } from "@/redux/store";
|
||||
import { AppProps } from "next/app";
|
||||
import { loadWindowVariables } from "../utils/loadWindowVariables";
|
||||
import { loadWindowVariables } from "@/utils/loadWindowVariables";
|
||||
|
||||
import Header from "../components/header/Header";
|
||||
import Navigation from "../components/navigation/Navigation";
|
||||
import Footer from "../components/footer/Footer";
|
||||
import Header from "@/components/header/Header";
|
||||
import Navigation from "@/components/navigation/Navigation";
|
||||
import Footer from "@/components/footer/Footer";
|
||||
|
||||
// Thunks importieren
|
||||
import { fetchKueDataThunk } from "../redux/thunks/fetchKueDataThunk";
|
||||
import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk";
|
||||
import { fetchAnalogInputsThunk } from "../redux/thunks/fetchAnalogInputsThunk";
|
||||
import { getAnalogInputsHistoryThunk } from "../redux/thunks/getAnalogInputsHistoryThunk";
|
||||
import { fetchLast20MessagesThunk } from "../redux/thunks/fetchLast20MessagesThunk";
|
||||
import { fetchOpcUaSettingsThunk } from "../redux/thunks/fetchOpcUaSettingsThunk";
|
||||
import { fetchSystemSettingsThunk } from "../redux/thunks/fetchSystemSettingsThunk";
|
||||
import { fetchSystemVoltTempThunk } from "../redux/thunks/fetchSystemVoltTempThunk";
|
||||
import { fetchReferenceCurveBySlotThunk } from "../redux/thunks/fetchReferenceCurveBySlotThunk";
|
||||
import { getKueDataThunk } from "@/redux/thunks/getKueDataThunk";
|
||||
import { getDigitalOutputsThunk } from "@/redux/thunks/getDigitalOutputsThunk";
|
||||
import { getAnalogInputsThunk } from "@/redux/thunks/getAnalogInputsThunk";
|
||||
import { getAnalogInputsHistoryThunk } from "@/redux/thunks/getAnalogInputsHistoryThunk";
|
||||
import { getLast20MessagesThunk } from "@/redux/thunks/getLast20MessagesThunk";
|
||||
import { getOpcUaSettingsThunk } from "@/redux/thunks/getOpcUaSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "@/redux/thunks/getSystemSettingsThunk";
|
||||
import { getSystemVoltTempThunk } from "@/redux/thunks/getSystemVoltTempThunk";
|
||||
import { getReferenceCurveBySlotThunk } from "@/redux/thunks/getReferenceCurveBySlotThunk";
|
||||
import { getAllTDRReferenceChartThunk } from "@/redux/thunks/getAllTDRReferenceChartThunk";
|
||||
import { fetchTDRChartDataByIdThunk } from "../redux/thunks/fetchTDRChartDataByIdThunk";
|
||||
import { fetchLoopChartDataThunk } from "../redux/thunks/fetchLoopChartDataThunk";
|
||||
import { getTDRChartDataByIdThunk } from "@/redux/thunks/getTDRChartDataByIdThunk";
|
||||
import { getLoopChartDataThunk } from "@/redux/thunks/getLoopChartDataThunk";
|
||||
|
||||
import "../styles/globals.css";
|
||||
import "@/styles/globals.css";
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
@@ -35,7 +35,13 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||
);
|
||||
}
|
||||
|
||||
function AppContent({ Component, pageProps }: AppProps) {
|
||||
function AppContent({
|
||||
Component,
|
||||
pageProps,
|
||||
}: {
|
||||
Component: AppProps["Component"];
|
||||
pageProps: AppProps["pageProps"];
|
||||
}): JSX.Element {
|
||||
const dispatch = useAppDispatch();
|
||||
const [sessionExpired, setSessionExpired] = useState(false);
|
||||
|
||||
@@ -45,31 +51,31 @@ function AppContent({ Component, pageProps }: AppProps) {
|
||||
|
||||
const loadAndDispatch = () => {
|
||||
if (pathname.includes("kabelueberwachung")) {
|
||||
dispatch(fetchKueDataThunk());
|
||||
dispatch(getKueDataThunk());
|
||||
} else if (pathname.includes("digitalOutputs")) {
|
||||
dispatch(fetchDigitalOutputsThunk());
|
||||
dispatch(getDigitalOutputsThunk());
|
||||
} else if (pathname.includes("digitalInputs")) {
|
||||
dispatch(fetchDigitalOutputsThunk()); // 🟠 evtl. anpassen
|
||||
dispatch(getDigitalOutputsThunk()); // 🟠 evtl. anpassen
|
||||
} else if (pathname.includes("analogInputs")) {
|
||||
dispatch(fetchAnalogInputsThunk());
|
||||
dispatch(getAnalogInputsThunk());
|
||||
} else if (pathname.includes("analogHistory")) {
|
||||
dispatch(getAnalogInputsHistoryThunk());
|
||||
} else if (pathname.includes("dashboard")) {
|
||||
dispatch(fetchLast20MessagesThunk());
|
||||
dispatch(getLast20MessagesThunk());
|
||||
} else if (pathname.includes("einstellungen")) {
|
||||
dispatch(fetchOpcUaSettingsThunk());
|
||||
dispatch(getOpcUaSettingsThunk());
|
||||
} else if (pathname.includes("systemvolt")) {
|
||||
dispatch(fetchSystemVoltTempThunk());
|
||||
dispatch(getSystemVoltTempThunk());
|
||||
} else if (pathname.includes("system")) {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
} else if (pathname.includes("tdrRef")) {
|
||||
dispatch(getAllTDRReferenceChartThunk());
|
||||
} else if (pathname.includes("tdrSlot")) {
|
||||
dispatch(fetchReferenceCurveBySlotThunk());
|
||||
dispatch(getReferenceCurveBySlotThunk());
|
||||
} else if (pathname.includes("tdrId")) {
|
||||
dispatch(fetchTDRChartDataByIdThunk());
|
||||
dispatch(getTDRChartDataByIdThunk());
|
||||
} else if (pathname.includes("loopChart")) {
|
||||
dispatch(fetchLoopChartDataThunk());
|
||||
dispatch(getLoopChartDataThunk());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { useState, useEffect } from "react";
|
||||
import AnalogInputsTable from "../components/main/analogInputs/AnalogInputsTable";
|
||||
import AnalogInputsChart from "../components/main/analogInputs/AnalogInputsChart";
|
||||
import AnalogInputsSettingsModal from "../components/main/analogInputs/AnalogInputsSettingsModal";
|
||||
import { fetchAnalogInputsThunk } from "../redux/thunks/fetchAnalogInputsThunk";
|
||||
import { getAnalogInputsThunk } from "../redux/thunks/getAnalogInputsThunk";
|
||||
import { useAppDispatch } from "../redux/store";
|
||||
|
||||
function AnalogInputs() {
|
||||
@@ -14,9 +14,9 @@ function AnalogInputs() {
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
dispatch(fetchAnalogInputsThunk());
|
||||
dispatch(getAnalogInputsThunk());
|
||||
const interval = setInterval(() => {
|
||||
dispatch(fetchAnalogInputsThunk());
|
||||
dispatch(getAnalogInputsThunk());
|
||||
}, 10000);
|
||||
return () => clearInterval(interval);
|
||||
}
|
||||
|
||||
@@ -9,16 +9,16 @@ import Last20MessagesTable from "../components/main/uebersicht/Last20MessagesTab
|
||||
import NetworkInfo from "../components/main/uebersicht/NetworkInfo";
|
||||
import VersionInfo from "../components/main/uebersicht/VersionInfo";
|
||||
import Baugruppentraeger from "../components/main/uebersicht/Baugruppentraeger";
|
||||
import { fetchLast20MessagesThunk } from "../redux/thunks/fetchLast20MessagesThunk";
|
||||
import { getLast20MessagesThunk } from "../redux/thunks/getLast20MessagesThunk";
|
||||
import { useAppDispatch } from "../redux/store";
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
//-------------------------------------
|
||||
const dispatch = useAppDispatch();
|
||||
useEffect(() => {
|
||||
dispatch(fetchLast20MessagesThunk());
|
||||
dispatch(getLast20MessagesThunk());
|
||||
const interval = setInterval(() => {
|
||||
dispatch(fetchLast20MessagesThunk());
|
||||
dispatch(getLast20MessagesThunk());
|
||||
}, 10000); // oder 5000
|
||||
|
||||
return () => clearInterval(interval);
|
||||
|
||||
@@ -6,8 +6,8 @@ import { AppDispatch, RootState } from "../redux/store";
|
||||
|
||||
import InputModal from "../components/main/einausgaenge/modals/InputModal";
|
||||
|
||||
import { fetchDigitalInputsThunk } from "@/redux/thunks/fetchDigitalInputsThunk";
|
||||
import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk";
|
||||
import { getDigitalInputsThunk } from "@/redux/thunks/getDigitalInputsThunk";
|
||||
import { getDigitalOutputsThunk } from "../redux/thunks/getDigitalOutputsThunk";
|
||||
|
||||
import DigitalInputs from "../components/main/einausgaenge/DigitalInputs";
|
||||
|
||||
@@ -26,12 +26,12 @@ const EinAusgaenge: React.FC = () => {
|
||||
const [isOutputModalOpen, setIsOutputModalOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchDigitalInputsThunk());
|
||||
dispatch(fetchDigitalOutputsThunk());
|
||||
dispatch(getDigitalInputsThunk());
|
||||
dispatch(getDigitalOutputsThunk());
|
||||
|
||||
const interval = setInterval(() => {
|
||||
dispatch(fetchDigitalInputsThunk());
|
||||
dispatch(fetchDigitalOutputsThunk());
|
||||
dispatch(getDigitalInputsThunk());
|
||||
dispatch(getDigitalOutputsThunk());
|
||||
}, 10000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
|
||||
@@ -5,8 +5,8 @@ import { AppDispatch, RootState } from "@/redux/store";
|
||||
|
||||
import DigitalOutputsModal from "../components/main/einausgaenge/modals/DigitalOutputsModal";
|
||||
|
||||
import { fetchDigitalInputsThunk } from "@/redux/thunks/fetchDigitalInputsThunk";
|
||||
import { fetchDigitalOutputsThunk } from "@/redux/thunks/fetchDigitalOutputsThunk";
|
||||
import { getDigitalInputsThunk } from "@/redux/thunks/getDigitalInputsThunk";
|
||||
import { getDigitalOutputsThunk } from "@/redux/thunks/getDigitalOutputsThunk";
|
||||
|
||||
import DigitalOutputs from "../components/main/einausgaenge/DigitalOutputsWidget";
|
||||
|
||||
@@ -21,11 +21,11 @@ const EinAusgaenge: React.FC = () => {
|
||||
const [isOutputModalOpen, setIsOutputModalOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchDigitalOutputsThunk());
|
||||
dispatch(getDigitalOutputsThunk());
|
||||
|
||||
const interval = setInterval(() => {
|
||||
dispatch(fetchDigitalInputsThunk());
|
||||
dispatch(fetchDigitalOutputsThunk());
|
||||
dispatch(getDigitalInputsThunk());
|
||||
dispatch(getDigitalOutputsThunk());
|
||||
}, 500);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// /pages/einstellungen.tsx
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useAppDispatch } from "../redux/store";
|
||||
import { fetchSystemSettingsThunk } from "../redux/thunks/fetchSystemSettingsThunk";
|
||||
import { getSystemSettingsThunk } from "../redux/thunks/getSystemSettingsThunk";
|
||||
import GeneralSettings from "../components/main/settingsPageComponents/GeneralSettings";
|
||||
import OPCUAInterfaceSettings from "../components/main/settingsPageComponents/OPCUAInterfaceSettings";
|
||||
import DatabaseSettings from "../components/main/settingsPageComponents/DatabaseSettings";
|
||||
@@ -13,7 +13,7 @@ export default function Settings() {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
dispatch(getSystemSettingsThunk());
|
||||
}, [dispatch]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@ import Kue705FO from "../components/main/kabelueberwachung/kue705FO/Kue705FO";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { AppDispatch } from "../redux/store"; // Adjust the path to your Redux store file
|
||||
import { RootState } from "../redux/store"; // Adjust the path to your Redux store file
|
||||
import { fetchKueDataThunk } from "../redux/thunks/fetchKueDataThunk";
|
||||
import { getKueDataThunk } from "../redux/thunks/getKueDataThunk";
|
||||
|
||||
function Kabelueberwachung() {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
@@ -119,8 +119,8 @@ function Kabelueberwachung() {
|
||||
//------------------------------------------------------------
|
||||
useEffect(() => {
|
||||
if (kueIso.length === 0) {
|
||||
console.log("📦 Lade KUE-Daten aus fetchKueDataThunk...");
|
||||
dispatch(fetchKueDataThunk());
|
||||
console.log("📦 Lade KUE-Daten aus getKueDataThunk...");
|
||||
dispatch(getKueDataThunk());
|
||||
}
|
||||
}, []);
|
||||
//------------------------------------------------------------
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { AppDispatch, RootState } from "../redux/store";
|
||||
import { fetchSystemVoltTempThunk } from "../redux/thunks/fetchSystemVoltTempThunk";
|
||||
import { getSystemVoltTempThunk } from "../redux/thunks/getSystemVoltTempThunk";
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
@@ -35,9 +35,9 @@ const SystemPage = () => {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchSystemVoltTempThunk());
|
||||
dispatch(getSystemVoltTempThunk());
|
||||
const interval = setInterval(() => {
|
||||
dispatch(fetchSystemVoltTempThunk());
|
||||
dispatch(getSystemVoltTempThunk());
|
||||
}, 5000);
|
||||
return () => clearInterval(interval);
|
||||
}, [dispatch]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// /redux/slices/loopChartSlice.ts
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
import { fetchLoopChartDataThunk } from "../thunks/fetchLoopChartDataThunk";
|
||||
import { getLoopChartDataThunk } from "../thunks/getLoopChartDataThunk";
|
||||
|
||||
interface ChartData {
|
||||
[mode: string]: {
|
||||
@@ -26,11 +26,11 @@ const loopChartSlice = createSlice({
|
||||
reducers: {},
|
||||
extraReducers: (builder) => {
|
||||
builder
|
||||
.addCase(fetchLoopChartDataThunk.pending, (state) => {
|
||||
.addCase(getLoopChartDataThunk.pending, (state) => {
|
||||
state.loading = true;
|
||||
state.error = null;
|
||||
})
|
||||
.addCase(fetchLoopChartDataThunk.fulfilled, (state, action) => {
|
||||
.addCase(getLoopChartDataThunk.fulfilled, (state, action) => {
|
||||
state.loading = false;
|
||||
const { mode, type } = action.meta.arg;
|
||||
if (!state.data[mode]) {
|
||||
@@ -38,7 +38,7 @@ const loopChartSlice = createSlice({
|
||||
}
|
||||
state.data[mode][type] = action.payload;
|
||||
})
|
||||
.addCase(fetchLoopChartDataThunk.rejected, (state, action) => {
|
||||
.addCase(getLoopChartDataThunk.rejected, (state, action) => {
|
||||
state.loading = false;
|
||||
state.error = action.payload as string;
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// /redux/slices/tdmSingleChartSlice.ts
|
||||
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { fetchTDMDataBySlotThunk } from "../thunks/fetchTDMListBySlotThunk";
|
||||
import { fetchTDMDataBySlotThunk } from "../thunks/getTDMListBySlotThunk";
|
||||
|
||||
interface TDMChartEntry {
|
||||
id: number;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// redux/slices/tdrDataByIdSlice.ts
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { fetchTDRChartDataByIdThunk } from "../thunks/fetchTDRChartDataByIdThunk";
|
||||
import { getTDRChartDataByIdThunk } from "../thunks/getTDRChartDataByIdThunk";
|
||||
|
||||
const initialState = {
|
||||
dataById: {} as Record<number, { d: number; p: number }[]>,
|
||||
@@ -22,7 +22,7 @@ const tdrDataByIdSlice = createSlice({
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(fetchTDRChartDataByIdThunk.fulfilled, (state, action) => {
|
||||
builder.addCase(getTDRChartDataByIdThunk.fulfilled, (state, action) => {
|
||||
const { id, data } = action.payload;
|
||||
state.dataById[id] = data;
|
||||
state.selectedId = id;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// /redux/slices/tdrReferenceChartDataBySlotSlice.ts
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { fetchReferenceCurveBySlotThunk } from "../thunks/fetchReferenceCurveBySlotThunk";
|
||||
import { getReferenceCurveBySlotThunk } from "../thunks/getReferenceCurveBySlotThunk";
|
||||
|
||||
interface TDRReferenceChartState {
|
||||
referenceData: { [slot: number]: any[] };
|
||||
@@ -20,18 +20,18 @@ const tdrReferenceChartDataBySlotSlice = createSlice({
|
||||
reducers: {},
|
||||
extraReducers: (builder) => {
|
||||
builder
|
||||
.addCase(fetchReferenceCurveBySlotThunk.pending, (state) => {
|
||||
.addCase(getReferenceCurveBySlotThunk.pending, (state) => {
|
||||
state.loading = true;
|
||||
state.error = null;
|
||||
})
|
||||
.addCase(
|
||||
fetchReferenceCurveBySlotThunk.fulfilled,
|
||||
getReferenceCurveBySlotThunk.fulfilled,
|
||||
(state, action: PayloadAction<{ slot: number; data: any[] }>) => {
|
||||
state.loading = false;
|
||||
state.referenceData[action.payload.slot] = action.payload.data;
|
||||
}
|
||||
)
|
||||
.addCase(fetchReferenceCurveBySlotThunk.rejected, (state, action) => {
|
||||
.addCase(getReferenceCurveBySlotThunk.rejected, (state, action) => {
|
||||
state.loading = false;
|
||||
state.error = action.error.message ?? "Unbekannter Fehler";
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// /redux/thunks/fetchAnalogInputsThunk.ts
|
||||
// /redux/thunks/getAnalogInputsThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchAnalogInputsService } from "@/services/fetchAnalogInputsService";
|
||||
import { setAnalogInputs } from "@/redux/slices/analogInputsSlice";
|
||||
@@ -6,7 +6,7 @@ import { setAnalogInputs } from "@/redux/slices/analogInputsSlice";
|
||||
/**
|
||||
* Holt die analogen Eingänge von der API und speichert sie in Redux.
|
||||
*/
|
||||
export const fetchAnalogInputsThunk = createAsyncThunk(
|
||||
export const getAnalogInputsThunk = createAsyncThunk(
|
||||
"analogeInputs/fetchAnalogInputs",
|
||||
async (_, { dispatch }) => {
|
||||
if (typeof window === "undefined") return; // Server-Side Execution blockieren
|
||||
@@ -1,4 +1,4 @@
|
||||
// @/redux/thunks/fetchDigitalInputsThunk.ts
|
||||
// @/redux/thunks/getDigitalInputsThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchDigitalInputsService } from "@/services/fetchDigitalInputsService";
|
||||
import { setInputs } from "@/redux/slices/digitalInputsSlice";
|
||||
@@ -6,7 +6,7 @@ import { setInputs } from "@/redux/slices/digitalInputsSlice";
|
||||
/**
|
||||
* Holt digitale Eingänge von der API und speichert sie in Redux.
|
||||
*/
|
||||
export const fetchDigitalInputsThunk = createAsyncThunk(
|
||||
export const getDigitalInputsThunk = createAsyncThunk(
|
||||
"digitalInputs/fetchDigitalInputs",
|
||||
async (_, { dispatch }) => {
|
||||
if (typeof window === "undefined") return;
|
||||
@@ -1,10 +1,10 @@
|
||||
// ✅ Thunk: /redux/thunks/fetchDigitalOutputsThunk.ts
|
||||
// ✅ Thunk: /redux/thunks/getDigitalOutputsThunk.ts
|
||||
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchDigitalOutputsService } from "../../services/fetchDigitalOutputsService";
|
||||
import { setDigitalOutputs } from "../slices/digitalOutputsSlice";
|
||||
|
||||
export const fetchDigitalOutputsThunk = createAsyncThunk(
|
||||
export const getDigitalOutputsThunk = createAsyncThunk(
|
||||
"digitalOutputs/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const outputs = await fetchDigitalOutputsService();
|
||||
@@ -1,10 +1,10 @@
|
||||
// ✅ Thunk: /redux/thunks/fetchKueDataThunk.ts
|
||||
// ✅ Thunk: /redux/thunks/getKueDataThunk.ts
|
||||
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchKueDataService } from "../../services/fetchKueDataService";
|
||||
import { setKueData } from "../slices/kueDataSlice";
|
||||
|
||||
export const fetchKueDataThunk = createAsyncThunk(
|
||||
export const getKueDataThunk = createAsyncThunk(
|
||||
"kueData/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const data = await fetchKueDataService();
|
||||
@@ -1,9 +1,9 @@
|
||||
// /redux/thunks/fetchLast20MessagesThunk.ts
|
||||
// /redux/thunks/getLast20MessagesThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchLast20MessagesFromWindow } from "../../services/fetchLast20MessagesService";
|
||||
import { setLast20Messages } from "../slices/last20MessagesSlice";
|
||||
|
||||
export const fetchLast20MessagesThunk = createAsyncThunk(
|
||||
export const getLast20MessagesThunk = createAsyncThunk(
|
||||
"last20Messages/fetchLast20Messages",
|
||||
async (_, { dispatch }) => {
|
||||
const messages = await fetchLast20MessagesFromWindow();
|
||||
@@ -1,4 +1,4 @@
|
||||
// /redux/thunks/fetchLoopChartDataThunk.ts
|
||||
// /redux/thunks/getLoopChartDataThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchLoopChartData } from "../../services/fetchLoopChartDataService";
|
||||
|
||||
@@ -10,7 +10,7 @@ interface FetchLoopChartDataParams {
|
||||
bisDatum: string;
|
||||
}
|
||||
|
||||
export const fetchLoopChartDataThunk = createAsyncThunk(
|
||||
export const getLoopChartDataThunk = createAsyncThunk(
|
||||
"loopChart/fetchLoopChartData",
|
||||
async (params: FetchLoopChartDataParams, { rejectWithValue }) => {
|
||||
try {
|
||||
@@ -28,7 +28,7 @@ export const fetchLoopChartDataThunk = createAsyncThunk(
|
||||
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error("❌ Fehler in fetchLoopChartDataThunk:", error);
|
||||
console.error("❌ Fehler in getLoopChartDataThunk:", error);
|
||||
return rejectWithValue(error.message || "Unbekannter Fehler");
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// ✅ 2. Thunk: /redux/thunks/fetchOpcUaSettingsThunk.ts
|
||||
// ✅ 2. Thunk: /redux/thunks/getOpcUaSettingsThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchOpcUaSettingsService } from "../../services/fetchOpcUaSettingsService";
|
||||
import {
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
//setOpcUaUsers,
|
||||
} from "../slices/opcuaSettingsSlice";
|
||||
|
||||
export const fetchOpcUaSettingsThunk = createAsyncThunk(
|
||||
export const getOpcUaSettingsThunk = createAsyncThunk(
|
||||
"opcuaSettings/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const data = await fetchOpcUaSettingsService();
|
||||
@@ -1,8 +1,8 @@
|
||||
// /redux/thunks/fetchReferenceCurveBySlotThunk.ts
|
||||
// /redux/thunks/getReferenceCurveBySlotThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchTDRReferenceCurveService } from "../../services/fetchTDRReferenceCurveService";
|
||||
|
||||
export const fetchReferenceCurveBySlotThunk = createAsyncThunk(
|
||||
export const getReferenceCurveBySlotThunk = createAsyncThunk(
|
||||
"tdrReferenceChart/fetchBySlot",
|
||||
async (slot: number) => {
|
||||
const data = await fetchTDRReferenceCurveService(slot);
|
||||
@@ -1,9 +1,9 @@
|
||||
// /redux/thunks/fetchSystemSettingsThunk.ts
|
||||
// /redux/thunks/getSystemSettingsThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchSystemService } from "../../services/fetchSystemService";
|
||||
import { setSystemSettings } from "../slices/systemSettingsSlice";
|
||||
|
||||
export const fetchSystemSettingsThunk = createAsyncThunk(
|
||||
export const getSystemSettingsThunk = createAsyncThunk(
|
||||
"systemSettings/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const data = await fetchSystemService();
|
||||
@@ -1,9 +1,9 @@
|
||||
// /redux/thunks/fetchSystemVoltTempThunk.ts
|
||||
// /redux/thunks/getSystemVoltTempThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchSystemVoltTempService } from "../../services/fetchSystemVoltTempService";
|
||||
import { setVoltages, addHistory } from "../slices/systemVoltTempSlice";
|
||||
|
||||
export const fetchSystemVoltTempThunk = createAsyncThunk(
|
||||
export const getSystemVoltTempThunk = createAsyncThunk(
|
||||
"systemVoltTemp/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const data = await fetchSystemVoltTempService();
|
||||
@@ -1,8 +1,8 @@
|
||||
// /redux/thunks/fetchTDRChartDataByIdThunk.ts
|
||||
// /redux/thunks/getTDRChartDataByIdThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchTDRChartDataByIdService } from "../../services/fetchTDRChartDataByIdService";
|
||||
|
||||
export const fetchTDRChartDataByIdThunk = createAsyncThunk(
|
||||
export const getTDRChartDataByIdThunk = createAsyncThunk(
|
||||
"tdrDataById/fetchById",
|
||||
async (id: number) => {
|
||||
const data = await fetchTDRChartDataByIdService(id);
|
||||
Reference in New Issue
Block a user