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

// axios.defaults.baseURL = "https://core-inventory.iran.liara.run/";

export const slaughterSupplyInventory = createAsyncThunk(
  "SLAUGHTER_SUPPLY_INVENTORY",
  async (basicUserData, warehouseData) => {
    const createBasicUser = await axios.post("users/create", basicUserData);
    // const userId = createBasicUser.data.Id;
    if (createBasicUser.status === 200 || createBasicUser.status === 402) {
      await axios.post("warehouses/create/", warehouseData);
    }
    // return { data, status };
  }
);
