import axios from "axios";
import { baseUrl } from "../../constants/urls";

export const fetchProductsByBrand = async (brandId: any) => {
  const url = `${baseUrl}/api/products?category_id=1&page=1&limit=30&brand=${brandId}`;

  const featuredProducts = await axios.get(url);
  return featuredProducts;
};

export const fetchBrandsList = async () => {
  const url = `${baseUrl}/api/productsCategories?category_id=1&page=1&limit=30`;

  const featuredBrand = await axios.get(url);
  let brands;
  if (featuredBrand) {
    brands = featuredBrand.data.brand;
  }

  return brands;
};
