import axios from "../../../config/axios";

export const getIdWithSlug = async (slug: string) => {
  const { data } = await axios.get(`/business/slug/${slug}`);
  return data;
};

export const getIndustry = async () => {
  const { data } = await axios.get(`/industries/list/public`);
  return data;
};

export const getCompanies = async (industryId: string) => {
  const params = new URLSearchParams();
  if (industryId) {
    params.append("industryId", industryId);
  }
  const { data } = await axios.get(
    `/companies/list/public?${params.toString()}`
  );
  return data;
};

export const getCompanyDetail = async (id: string) => {
  const { data } = await axios.get(`/companies/public/${id}`);
  return data;
};
