chore: fetch to get in redux thunks files name
This commit is contained in:
15
redux/thunks/getKueDataThunk.ts
Normal file
15
redux/thunks/getKueDataThunk.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// ✅ Thunk: /redux/thunks/getKueDataThunk.ts
|
||||
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchKueDataService } from "../../services/fetchKueDataService";
|
||||
import { setKueData } from "../slices/kueDataSlice";
|
||||
|
||||
export const getKueDataThunk = createAsyncThunk(
|
||||
"kueData/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const data = await fetchKueDataService();
|
||||
if (data) {
|
||||
dispatch(setKueData(data));
|
||||
}
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user