wip digitale Eingänge sind sichtbar aber keine Werte in Modal
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
// @/redux/thunks/fetchDigitalInputsThunk.ts
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { fetchDigitaleEingaengeService } from "../../services/fetchDigitaleEingaengeService";
|
||||
import { setInputs } from "../slices/digitalInputsSlice";
|
||||
import { fetchDigitalInputsService } from "@/services/fetchDigitalInputsService";
|
||||
import { setInputs } from "@/redux/slices/digitalInputsSlice";
|
||||
|
||||
/**
|
||||
* Holt digitale Eingänge von der API und speichert sie in Redux.
|
||||
*/
|
||||
export const fetchDigitaleEingaengeThunk = createAsyncThunk(
|
||||
"digitalInputs/fetchDigitaleEingaenge",
|
||||
export const fetchDigitalInputsThunk = createAsyncThunk(
|
||||
"digitalInputs/fetchDigitalInputs",
|
||||
async (_, { dispatch }) => {
|
||||
if (typeof window === "undefined") return;
|
||||
|
||||
try {
|
||||
const data = await fetchDigitaleEingaengeService();
|
||||
const data = await fetchDigitalInputsService();
|
||||
if (data) {
|
||||
dispatch(setInputs(data)); // ✅ Redux mit API-Daten füllen
|
||||
}
|
||||
Reference in New Issue
Block a user