chore: fetch to get in redux thunks files name
This commit is contained in:
12
redux/thunks/getSystemSettingsThunk.ts
Normal file
12
redux/thunks/getSystemSettingsThunk.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// /redux/thunks/getSystemSettingsThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchSystemService } from "../../services/fetchSystemService";
|
||||
import { setSystemSettings } from "../slices/systemSettingsSlice";
|
||||
|
||||
export const getSystemSettingsThunk = createAsyncThunk(
|
||||
"systemSettings/fetch",
|
||||
async (_, { dispatch }) => {
|
||||
const data = await fetchSystemService();
|
||||
if (data) dispatch(setSystemSettings(data));
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user