Skip to content

Commit

Permalink
chore: get log
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis authored Aug 16, 2023
1 parent 71f0904 commit 856fb20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion functions/lib/gmc-to-ecom.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ const saveEcomProduct = async (appSdk, appData, storeId, feedProduct, variations
const method = _id ? 'PATCH' : 'POST'
const parsedProduct = await parseProduct(appSdk, appData, auth, storeId, feedProduct, product, meta)
let ecomResponse = {}

console.log('Enviando produto', JSON.stringify(parseProduct))
if (appData.update_product || method === 'POST') {
const ecomRequest = { resource, method, parsedProduct: JSON.stringify(parsedProduct || '') }
meta.ecomRequest = ecomRequest
Expand Down
4 changes: 2 additions & 2 deletions functions/lib/table-to-ecom.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const MAPPED_COLUMNS = [
feedColumn: 'g:gtin'
},
{
tableColumn: 'mpn',
tableColumn: 'ncm',
feedColumn: 'g:mpn'
},
{
Expand Down Expand Up @@ -261,7 +261,7 @@ const parseProduct = async (buffer, contentType) => {
if (columns.includes(mapped.tableColumn)) {
if (typeof mapped.parser === 'function') {
data[mapped.feedColumn] = mapped.parser(row, row.getCell(mapped.feedColumn).text, { sheetResult, data })
if (data[mapped.feedColumn] && data[mapped.feedColumn].length === 0) {
if (row.getCell(mapped.feedColumn).text === 'sem-variacao') {
delete data[mapped.feedColumn]
}
} else {
Expand Down
3 changes: 0 additions & 3 deletions functions/lib/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ const run = async (snap, data = null) => {
: [product['g:additional_image_link']]

const imageLinks = _.compact([product['g:image_link'], ...(aditionalImages || [])])
if (storeId == 51412) {
console.log('Images #51412', JSON.stringify(imageLinks), JSON.stringify(product))
}

switch (resource) {
case 'applications':
Expand Down

0 comments on commit 856fb20

Please sign in to comment.