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

export const fetchReferenceCurveBySlotThunk = createAsyncThunk(
  "tdrReferenceChart/fetchBySlot",
  async (slot: number) => {
    const data = await fetchTDRReferenceCurveService(slot);
    if (!data) throw new Error("Keine Referenzdaten gefunden");
    return { slot, data };
  }
);
