import { apiPublic } from './api';

export const getAffLink = async (platform = '') => {
  return apiPublic.get('/public/tracking/get', {
    params: {
      platform,
    },
  });
};

export const downloadVideoShopee = async (videoId) => {
  return apiPublic.post('/public/shopee/product/downloadVideo', {
    videoId,
  });
};

/**
 *
 * @param {number} shopId
 * @param {number} productId
 * @returns {Promise<ShopeeProductExtraInfo>}
 */
export const getShopeeProductExtraInfo = async (shopId, productId) => {
  const { data } = await apiPublic.get('/public/shopee/productSync/data', {
    params: {
      shopId,
      productId,
    },
  });
  return data;
};
