From 0e5d47dc793873cd2ce10985af077ddaa3b8e792 Mon Sep 17 00:00:00 2001 From: Leonardo Matos Date: Tue, 16 Jul 2024 11:38:26 -0300 Subject: [PATCH] Update export-order.js --- functions/lib/ux-group/export-order.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/lib/ux-group/export-order.js b/functions/lib/ux-group/export-order.js index fa8b48c..ed2a0b8 100644 --- a/functions/lib/ux-group/export-order.js +++ b/functions/lib/ux-group/export-order.js @@ -133,7 +133,7 @@ module.exports = async ( headers: { Authorization: `Basic ${uxToken}` }, timeout: 7000 }) - if (response && response.data && response.data.mensagem === 'OK' && response.data.resultados && && response.data.resultados.length) { + if (response?.data?.mensagem === 'OK' && response.data.resultados?.length) { const result = response.data.resultados[0] console.log('order sent', order._id, number, result.idSolicitacaoGerada, result.idSolicitacaoInterno) const volume = result.listaVolumes && result.listaVolumes.length && result.listaVolumes[0]