chore: fetch to get in redux thunks files name
This commit is contained in:
@@ -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