feat: APIs erstellt für Systemspannungen
This commit is contained in:
15
redux/thunks/getSystemspannung15VplusThunk.ts
Normal file
15
redux/thunks/getSystemspannung15VplusThunk.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchSystemspannung15VplusService } from "@/services/fetchSystemspannung15VplusService";
|
||||
|
||||
export const getSystemspannung15VplusThunk = createAsyncThunk(
|
||||
"systemspannung15Vplus/fetch",
|
||||
async (typ: "DIA0" | "DIA1" | "DIA2", thunkAPI) => {
|
||||
try {
|
||||
const data = await fetchSystemspannung15VplusService(typ);
|
||||
return { typ, data };
|
||||
} catch (error) {
|
||||
console.error("Fehler in getSystemspannung15VplusThunk:", error);
|
||||
return thunkAPI.rejectWithValue("Fehler beim Laden der +15V-Daten");
|
||||
}
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user