Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 authored Nov 27, 2024
1 parent 5287ff0 commit fbe0adb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions functions/lib/integration/parsers/order-to-ecomplus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ module.exports = (blingOrder, shippingLines, bling, storeId) => new Promise((res
const checkTrackingCodes = ({ codigosRastreamento, transporte }) => {
const addTrackingCode = (shippingLine, volume) => {
let tracking
if (
volume &&
volume.codigoRastreamento &&
(!shippingLine.tracking_codes || !shippingLine.tracking_codes.length)
) {
const hasTrackingCode = shippingLine.tracking_codes && shippingLine.tracking_codes.some(({ code }) => {
return !code.includes('Sem ')
})
if (volume && (volume.urlRastreamento || volume.codigoRastreamento) && !hasTrackingCode) {
tracking = {
code: String(volume.codigoRastreamento),
code: volume.codigoRastreamento ? String(volume.codigoRastreamento) : 'Sem código | Consultar no link',
link: volume.urlRastreamento ||
`https://www.melhorrastreio.com.br/rastreio/${volume.codigoRastreamento}`
}
Expand Down

0 comments on commit fbe0adb

Please sign in to comment.