16 lines
524 B
TypeScript
16 lines
524 B
TypeScript
// /redux/thunks/getAnalogInputsHistoryThunk.ts
|
|
import { createAsyncThunk } from "@reduxjs/toolkit";
|
|
import { fetchAnalogInputsHistoryService } from "@/services/fetchAnalogInputsHistoryService";
|
|
|
|
export const getAnalogInputsHistoryThunk = createAsyncThunk(
|
|
"analogInputsHistory/fetch",
|
|
async (_, { rejectWithValue }) => {
|
|
try {
|
|
const data = await fetchAnalogInputsHistoryService();
|
|
return data;
|
|
} catch (error: any) {
|
|
return rejectWithValue(error.message || "Unbekannter Fehler");
|
|
}
|
|
}
|
|
);
|