import { api } from "@/config/axios";
import {
  CategoriesResponse,
  ProductsResponse,
  NotificationsCountResponse,
} from "../types/Types";

export const getProducts = async (slug: string): Promise<ProductsResponse> => {
  const response = await api.get<ProductsResponse>(
    `/public/products/shop/${slug}`
  );
  return response.data;
};

export const getCategories = async (
  slug: string
): Promise<CategoriesResponse> => {
  const response = await api.get<CategoriesResponse>(
    `/public/categories/shop/${slug}`
  );
  return response.data;
};

export const getNotificationsCount = async (): Promise<
  NotificationsCountResponse
> => {
  const response = await api.get<NotificationsCountResponse>(
    `/public/notifications/unseen-count`
  );
  return response.data;
};
