cambios para visualizar data enviada

This commit is contained in:
2026-06-19 16:01:25 -04:00
parent 9c07590483
commit 60fdd6099e
2 changed files with 4 additions and 3 deletions

View File

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

View File

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