chore: fetch to get in redux thunks files name

This commit is contained in:
Ismail Ali
2025-06-21 10:15:05 +02:00
parent dd76665848
commit 7740806952
42 changed files with 144 additions and 126 deletions

View File

@@ -0,0 +1,15 @@
// /redux/thunks/getSystemVoltTempThunk.ts
import { createAsyncThunk } from "@reduxjs/toolkit";
import { fetchSystemVoltTempService } from "../../services/fetchSystemVoltTempService";
import { setVoltages, addHistory } from "../slices/systemVoltTempSlice";
export const getSystemVoltTempThunk = createAsyncThunk(
"systemVoltTemp/fetch",
async (_, { dispatch }) => {
const data = await fetchSystemVoltTempService();
if (data) {
dispatch(setVoltages(data));
dispatch(addHistory({ time: Date.now(), ...data }));
}
}
);