import { CategoryPromo, IPromotion } from '~/common/types/promotion'; export const getVariantById = async (variantId: number) => { const url = `/api/product-variant/${variantId}`; return await fetch(url).then((res) => res.json()); }; export const getVariantPromoByCategory = async ( variantId: number, type: CategoryPromo ): Promise<{ data: IPromotion[] }> => { const url = `/api/product-variant/${variantId}/promotion/${type}`; return await fetch(url).then((res) => res.json()); };