Skip to content

Commit

Permalink
fix(import-products): add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Oct 4, 2024
1 parent 2fe1bfb commit 6e6aa2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions functions/lib/integration/import-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ module.exports = async ({ appSdk, storeId, auth }, _blingStore, blingDeposit, qu
const { product, variationId } = payload
const isStockOnly = Boolean(product && !(appData.update_product || appData.update_product_auto))
return createUpdateProduct({ appSdk, storeId, auth }, appData, sku, product, variationId, blingDeposit, blingProduct, isStockOnly)
.catch(err => {
if (err.response && err.response.data) {
logger.warn(`${err.response.data}`)
}
throw err
})
})
.catch(err => {
if (err.message === 'Skip') {
Expand Down
4 changes: 2 additions & 2 deletions functions/lib/integration/parsers/product-to-ecomplus.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const ecomUtils = require('@ecomplus/utils')
const axios = require('axios')
const { logger } = require('../../../context')
// const { logger } = require('../../../context')
const FormData = require('form-data')

const removeAccents = str => str.replace(/áàãâÁÀÃÂ/g, 'a')
Expand Down Expand Up @@ -315,7 +315,7 @@ module.exports = (blingProduct, variations, storeId, auth, isNew = true, appData
variation.specifications = specifications
variation.quantity = variacao.estoqueAtual || 0

logger.warn(`BlingV: ${JSON.stringify(variacao)} v:${JSON.stringify(variation)}`)
// logger.warn(`BlingV: ${JSON.stringify(variacao)} v:${JSON.stringify(variation)}`)

if (pictureId > 0) {
variation.picture_id = pictureId
Expand Down

0 comments on commit 6e6aa2f

Please sign in to comment.