import { apiApp } from '../api';

export const getListShop = async () => {
  return apiApp.get('/tiktok/shop/list');
};

export const refreshToken = async (id) => {
  return apiApp.get(`/tiktok/shop/refresh/${id}`);
};

export const getShopWarehouse = async (id) => {
  return apiApp.get(`/tiktok/handler/warehouse/${id}`);
};

export const importProduct = async (product, option = {}) => {
  return apiApp.post('/tiktok/product/import', {
    data: product,
    option,
  });
};

export const saveUpload = async (product, shopRef, warehouseId) => {
  return apiApp.post('/tiktok/upload/single/save', {
    shopRef,
    warehouseId,
    product,
  });
};

export const handlerUpload = async (id) => {
  return apiApp.post(`/tiktok/upload/product/run/${id}`);
};
