// /redux/thunks/fetchAnalogInputsHistoryThunk.ts
import { createAsyncThunk } from "@reduxjs/toolkit";
import { fetchAnalogInputsHistoryService } from "../../services/fetchAnalogInputsHistoryService";

export const fetchAnalogInputsHistoryThunk = createAsyncThunk(
  "analogInputsHistory/fetch",
  async (_, { rejectWithValue }) => {
    try {
      const data = await fetchAnalogInputsHistoryService();
      return data;
    } catch (error: any) {
      return rejectWithValue(error.message || "Unbekannter Fehler");
    }
  }
);
