From 60fdd6099e2d89214fd735bc0651b5e4c9c8a679 Mon Sep 17 00:00:00 2001 From: dmunozv Date: Fri, 19 Jun 2026 16:01:25 -0400 Subject: [PATCH] cambios para visualizar data enviada --- src/services/envioDte.js | 4 ++-- src/utils/utils.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/envioDte.js b/src/services/envioDte.js index c8fbf4f..af2bc26 100644 --- a/src/services/envioDte.js +++ b/src/services/envioDte.js @@ -151,8 +151,8 @@ const envioDte = async () => { res = await sendRequestInfracommerce(payload, url); // console.log(payload) - Logger.info({ message: `Payload enviado: ${JSON.stringify(payload, null, 2)}`, proceso: 'cron' }); - Logger.info({ message: `Respuesta del documento ${NRODOC_LV}: ${JSON.stringify(res, null, 2)}`, proceso: 'cron' }); + // Logger.info({ message: `Payload enviado: ${JSON.stringify(payload, null, 2)}`, proceso: 'cron' }); + // Logger.info({ message: `Respuesta del documento ${NRODOC_LV}: ${JSON.stringify(res, null, 2)}`, proceso: 'cron' }); // if (res) { diff --git a/src/utils/utils.js b/src/utils/utils.js index 5e68bf9..fb56771 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -58,13 +58,14 @@ const sendRequestInfracommerce = async (payload, url) => { body: JSON.stringify(payload), }); - console.log(response) + if (!response.ok) { const res = await response.json(); const data = JSON.stringify(res, null, 2); throw new Error(`Error en la solicitud: ${response.status} ${data}`); } const result = await response.json(); + console.log('Respuesta ', result) return result; } catch (error) {