chore: rename service/thunk files to follow get/fetch naming convention
This commit is contained in:
@@ -6,5 +6,5 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.435
|
NEXT_PUBLIC_APP_VERSION=1.6.436
|
||||||
NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
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_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.435
|
NEXT_PUBLIC_APP_VERSION=1.6.436
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
## [1.6.436] – 2025-06-20
|
||||||
|
|
||||||
|
- Mocks erstellt für API für Entwicklungsumgebung
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.435] – 2025-06-20
|
## [1.6.435] – 2025-06-20
|
||||||
|
|
||||||
- auto CHANGELOG.md
|
- auto CHANGELOG.md
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import "chartjs-adapter-date-fns";
|
|||||||
import { de } from "date-fns/locale";
|
import { de } from "date-fns/locale";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import type { RootState, AppDispatch } from "../../../redux/store";
|
import type { RootState, AppDispatch } from "../../../redux/store";
|
||||||
import { fetchAnalogInputsHistoryThunk } from "../../../redux/thunks/fetchAnalogInputsHistoryThunk";
|
import { getAnalogInputsHistoryThunk } from "@/redux/thunks/getAnalogInputsHistoryThunk";
|
||||||
|
|
||||||
ChartJS.register(
|
ChartJS.register(
|
||||||
LineElement,
|
LineElement,
|
||||||
@@ -41,7 +41,7 @@ export default function AnalogInputsChart({
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(fetchAnalogInputsHistoryThunk());
|
dispatch(getAnalogInputsHistoryThunk());
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
if (!selectedId) {
|
if (!selectedId) {
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.435",
|
"version": "1.6.436",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.435",
|
"version": "1.6.436",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@iconify-icons/ri": "^1.2.10",
|
"@iconify-icons/ri": "^1.2.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.435",
|
"version": "1.6.436",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import Footer from "../components/footer/Footer";
|
|||||||
import { fetchKueDataThunk } from "../redux/thunks/fetchKueDataThunk";
|
import { fetchKueDataThunk } from "../redux/thunks/fetchKueDataThunk";
|
||||||
import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk";
|
import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk";
|
||||||
import { fetchAnalogInputsThunk } from "../redux/thunks/fetchAnalogInputsThunk";
|
import { fetchAnalogInputsThunk } from "../redux/thunks/fetchAnalogInputsThunk";
|
||||||
import { fetchAnalogInputsHistoryThunk } from "../redux/thunks/fetchAnalogInputsHistoryThunk";
|
import { getAnalogInputsHistoryThunk } from "../redux/thunks/getAnalogInputsHistoryThunk";
|
||||||
import { fetchLast20MessagesThunk } from "../redux/thunks/fetchLast20MessagesThunk";
|
import { fetchLast20MessagesThunk } from "../redux/thunks/fetchLast20MessagesThunk";
|
||||||
import { fetchOpcUaSettingsThunk } from "../redux/thunks/fetchOpcUaSettingsThunk";
|
import { fetchOpcUaSettingsThunk } from "../redux/thunks/fetchOpcUaSettingsThunk";
|
||||||
import { fetchSystemSettingsThunk } from "../redux/thunks/fetchSystemSettingsThunk";
|
import { fetchSystemSettingsThunk } from "../redux/thunks/fetchSystemSettingsThunk";
|
||||||
@@ -53,7 +53,7 @@ function AppContent({ Component, pageProps }: AppProps) {
|
|||||||
} else if (pathname.includes("analogInputs")) {
|
} else if (pathname.includes("analogInputs")) {
|
||||||
dispatch(fetchAnalogInputsThunk());
|
dispatch(fetchAnalogInputsThunk());
|
||||||
} else if (pathname.includes("analogHistory")) {
|
} else if (pathname.includes("analogHistory")) {
|
||||||
dispatch(fetchAnalogInputsHistoryThunk());
|
dispatch(getAnalogInputsHistoryThunk());
|
||||||
} else if (pathname.includes("dashboard")) {
|
} else if (pathname.includes("dashboard")) {
|
||||||
dispatch(fetchLast20MessagesThunk());
|
dispatch(fetchLast20MessagesThunk());
|
||||||
} else if (pathname.includes("einstellungen")) {
|
} else if (pathname.includes("einstellungen")) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// /pages/api/cpl/fetchAnalogInputsHistory.ts
|
// /pages/api/cpl/getAnalogInputsHistory.ts
|
||||||
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/slices/analogInputsHistorySlice.ts
|
// /redux/slices/analogInputsHistorySlice.ts
|
||||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||||
import { fetchAnalogInputsHistoryThunk } from "../thunks/fetchAnalogInputsHistoryThunk";
|
import { getAnalogInputsHistoryThunk } from "../thunks/getAnalogInputsHistoryThunk";
|
||||||
|
|
||||||
type InputHistoryState = {
|
type InputHistoryState = {
|
||||||
data: Record<number, any[]>;
|
data: Record<number, any[]>;
|
||||||
@@ -20,18 +20,18 @@ const analogInputsHistorySlice = createSlice({
|
|||||||
reducers: {},
|
reducers: {},
|
||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
builder
|
builder
|
||||||
.addCase(fetchAnalogInputsHistoryThunk.pending, (state) => {
|
.addCase(getAnalogInputsHistoryThunk.pending, (state) => {
|
||||||
state.isLoading = true;
|
state.isLoading = true;
|
||||||
state.error = null;
|
state.error = null;
|
||||||
})
|
})
|
||||||
.addCase(
|
.addCase(
|
||||||
fetchAnalogInputsHistoryThunk.fulfilled,
|
getAnalogInputsHistoryThunk.fulfilled,
|
||||||
(state, action: PayloadAction<Record<number, any[]>>) => {
|
(state, action: PayloadAction<Record<number, any[]>>) => {
|
||||||
state.data = action.payload;
|
state.data = action.payload;
|
||||||
state.isLoading = false;
|
state.isLoading = false;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.addCase(fetchAnalogInputsHistoryThunk.rejected, (state, action) => {
|
.addCase(getAnalogInputsHistoryThunk.rejected, (state, action) => {
|
||||||
state.isLoading = false;
|
state.isLoading = false;
|
||||||
state.error = action.payload as string;
|
state.error = action.payload as string;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// /redux/slices/tdmChartSlice.ts
|
// /redux/slices/tdmChartSlice.ts
|
||||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||||
import { fetchAllTDMData } from "../thunks/fetchAllTDMThunk";
|
import { fetchAllTDMData } from "../thunks/getAllTDMThunk";
|
||||||
import type { TDMEntry } from "../types/tdmEntryTypes";
|
import type { TDMEntry } from "../types/tdmEntryTypes";
|
||||||
|
|
||||||
interface TDMChartState {
|
interface TDMChartState {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// /redux/thunks/fetchAllTDMThunk.ts
|
// /redux/thunks/getAllTDMThunk.ts
|
||||||
|
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { RootState } from "../store";
|
import { RootState } from "../store";
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// /redux/thunks/fetchAnalogInputsHistoryThunk.ts
|
// /redux/thunks/getAnalogInputsHistoryThunk.ts
|
||||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||||
import { fetchAnalogInputsHistoryService } from "../../services/fetchAnalogInputsHistoryService";
|
import { fetchAnalogInputsHistoryService } from "@/services/fetchAnalogInputsHistoryService";
|
||||||
|
|
||||||
export const fetchAnalogInputsHistoryThunk = createAsyncThunk(
|
export const getAnalogInputsHistoryThunk = createAsyncThunk(
|
||||||
"analogInputsHistory/fetch",
|
"analogInputsHistory/fetch",
|
||||||
async (_, { rejectWithValue }) => {
|
async (_, { rejectWithValue }) => {
|
||||||
try {
|
try {
|
||||||
@@ -22,7 +22,7 @@ export async function fetchAnalogInputsHistoryService(): Promise<
|
|||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
// ⬇️ ENTWICKLUNG: über API-Handler
|
// ⬇️ ENTWICKLUNG: über API-Handler
|
||||||
const response = await fetch("/api/cpl/fetchAnalogInputsHistory");
|
const response = await fetch("/api/cpl/getAnalogInputsHistory");
|
||||||
if (!response.ok) throw new Error("Fehler beim Laden der Mock-Daten");
|
if (!response.ok) throw new Error("Fehler beim Laden der Mock-Daten");
|
||||||
return await response.json();
|
return await response.json();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user