chore: rename service/thunk files to follow get/fetch naming convention
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// /redux/thunks/fetchAllTDMThunk.ts
|
||||
// /redux/thunks/getAllTDMThunk.ts
|
||||
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { RootState } from "../store";
|
||||
@@ -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 {
|
||||
Reference in New Issue
Block a user