import { createAsyncThunk } from "@reduxjs/toolkit";
import axios from "axios";
import { getRoleFromUrl } from "../../../utils/getRoleFromUrl";
export const slaughterGetPaiedFactorsService = createAsyncThunk(
  "SLAUGHTER_GET_PAIED_FACTORS",
  async (d) => {
    const { data, status } = await axios.get(
      "kill_house_factor_province/?role=" + getRoleFromUrl(),
      {
        params: {
          date1: d.selectedDate1,
          date2: d.selectedDate2,
        },
      }
    );
    return { data, status };
  }
);
