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) {