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

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

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

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

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

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