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

export const getAcceptedSlaughterRequest = createAsyncThunk(
  "GET_ACCEPTED_SLAUGHTER_REQUEST",
  async ({ id, role_key }) => {
    const { data, status } = await axios.get("province_kill_request", {
      params: {
        id,
        role: getRoleFromUrl(),
        role_key: role_key || "",
      },
    });
    return { data, status };
  }
);
