import { createAsyncThunk } from "@reduxjs/toolkit";
import axios from "axios";

export const avicultureGetHatchingData = createAsyncThunk(
  "VET_GET_HATCHING",
  async (d) => {
    const { data, status } = await axios.get("poultry_hatching/", {
      params: {
        key: d.key || "",
      },
    });
    return { data, status };
  }
);

export const avicultureGetHatchingDataForIncreaseHatching = createAsyncThunk(
  "VET_GET_HATCHING_FOR_INCREASE",
  async (key) => {
    const { data, status } = await axios.get(
      "poultry_hatching/?increase=true&key=" + key
    );
    return { data, status };
  }
);
