import { api } from "@/config/axios";
import { ProductResponse } from "../../types/Types";

export const getProduct = async (id: string): Promise<ProductResponse> => {
  const { data } = await api.get<ProductResponse>(`/public/products/${id}`);
  return data;
};

export const toggleFavorite = async (productId: string) => {
  const { data } = await api.post(`/public/products/${productId}/favorite`);
  return data;
};
