From ef68884fe0b5f656540cfeddf1d3a6f711bd6259 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Mon, 20 Jan 2025 16:27:35 +0100 Subject: [PATCH] feat: refs #7569 refs#7569 sendEmailNotification --- loopback/locale/es.json | 2 +- modules/ticket/back/methods/ticket/saveSign.js | 2 +- modules/ticket/back/methods/ticket/specs/saveSign.spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index b9207d9cf..eff238150 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -395,5 +395,5 @@ "Holidays to past days not available": "Las vacaciones a días pasados no están disponibles", "Incorrect delivery order alert on route": "Alerta de orden de entrega incorrecta en ruta: {{ route }} zona: {{ zone }}", "Ticket has been delivered out of order": "El ticket {{ticket}} {{{fullUrl}}} no ha sigo entregado en su orden.", - "Price cannot be blank": "Price cannot be blank" + "Price cannot be blank": "El precio no puede estar en blanco" } \ No newline at end of file diff --git a/modules/ticket/back/methods/ticket/saveSign.js b/modules/ticket/back/methods/ticket/saveSign.js index 9c33797b6..f99311c39 100644 --- a/modules/ticket/back/methods/ticket/saveSign.js +++ b/modules/ticket/back/methods/ticket/saveSign.js @@ -174,7 +174,7 @@ module.exports = Self => { WHERE t.id = ?)` , [ticket.routeFk, orderState.id, ticket.id], myOptions); - if (ticketIncorrect && ticketIncorrect.length > 0) + if (ticketIncorrect?.length > 0) await sendMail(ctx, ticket.routeFk, ticket.id, ticket.zone().name); } diff --git a/modules/ticket/back/methods/ticket/specs/saveSign.spec.js b/modules/ticket/back/methods/ticket/specs/saveSign.spec.js index 9cc262ea0..3b426c2cf 100644 --- a/modules/ticket/back/methods/ticket/specs/saveSign.spec.js +++ b/modules/ticket/back/methods/ticket/specs/saveSign.spec.js @@ -60,7 +60,7 @@ describe('Ticket saveSign()', () => { expect(ticketTrackingAfter.name).toBe('Entregado en parte'); }); - fit('should send an email to notify that the delivery order is not correct', async() => { + it('should send an email to notify that the delivery order is not correct', async() => { const tx = await models.Ticket.beginTransaction({}); const ticketFk = 8; const priority = 5;