chore: rename service/thunk files to follow get/fetch naming convention

This commit is contained in:
ISA
2025-06-20 14:07:29 +02:00
parent 0388512f51
commit 38ee1ae381
13 changed files with 25 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
// /redux/slices/analogInputsHistorySlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { fetchAnalogInputsHistoryThunk } from "../thunks/fetchAnalogInputsHistoryThunk";
import { getAnalogInputsHistoryThunk } from "../thunks/getAnalogInputsHistoryThunk";
type InputHistoryState = {
data: Record<number, any[]>;
@@ -20,18 +20,18 @@ const analogInputsHistorySlice = createSlice({
reducers: {},
extraReducers: (builder) => {
builder
.addCase(fetchAnalogInputsHistoryThunk.pending, (state) => {
.addCase(getAnalogInputsHistoryThunk.pending, (state) => {
state.isLoading = true;
state.error = null;
})
.addCase(
fetchAnalogInputsHistoryThunk.fulfilled,
getAnalogInputsHistoryThunk.fulfilled,
(state, action: PayloadAction<Record<number, any[]>>) => {
state.data = action.payload;
state.isLoading = false;
}
)
.addCase(fetchAnalogInputsHistoryThunk.rejected, (state, action) => {
.addCase(getAnalogInputsHistoryThunk.rejected, (state, action) => {
state.isLoading = false;
state.error = action.payload as string;
});

View File

@@ -1,6 +1,6 @@
// /redux/slices/tdmChartSlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { fetchAllTDMData } from "../thunks/fetchAllTDMThunk";
import { fetchAllTDMData } from "../thunks/getAllTDMThunk";
import type { TDMEntry } from "../types/tdmEntryTypes";
interface TDMChartState {

View File

@@ -1,4 +1,4 @@
// /redux/thunks/fetchAllTDMThunk.ts
// /redux/thunks/getAllTDMThunk.ts
import { createAsyncThunk } from "@reduxjs/toolkit";
import { RootState } from "../store";

View File

@@ -1,8 +1,8 @@
// /redux/thunks/fetchAnalogInputsHistoryThunk.ts
// /redux/thunks/getAnalogInputsHistoryThunk.ts
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",
async (_, { rejectWithValue }) => {
try {