chore: fetch to get in redux thunks files name
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user