import axios from "@/config/axios";
import type { CatalogResponseType } from "@/pages/catalogue/types/Types";
import type { BusinessResponseType } from "../types/Types";

export const getBusinessCatalog = async (slug: string) => {
  const { data } = await axios.get<CatalogResponseType>(
    `/public/catalogue/business/slug/${slug}`,
  );
  return data;
};

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

export const getBusiness = async () => {
  const { data } = await axios.get<BusinessResponseType>(`/admin/business/me`);
  return data;
};
