From e7cd052199f1df73342d47631c8fd8ea5c4e2110 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 31 Aug 2023 13:49:00 +0200 Subject: [PATCH 1/2] refs #6132 add messageError --- loopback/locale/en.json | 3 ++- loopback/locale/es.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 46b48e2ea..5d2b7ab03 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -185,5 +185,6 @@ "You don't have enough privileges.": "You don't have enough privileges.", "This ticket is locked.": "This ticket is locked.", "This ticket is not editable.": "This ticket is not editable.", - "The ticket doesn't exist.": "The ticket doesn't exist." + "The ticket doesn't exist.": "The ticket doesn't exist.", + "Ticket without Route": "Ticket without route" } diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 195b683ad..ccd63e0ff 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -315,5 +315,6 @@ "This ticket is not editable.": "Este ticket no es editable.", "The ticket doesn't exist.": "No existe el ticket.", "Social name should be uppercase": "La razón social debe ir en mayúscula", - "Street should be uppercase": "La dirección fiscal debe ir en mayúscula" + "Street should be uppercase": "La dirección fiscal debe ir en mayúscula", + "Ticket without Route": "Ticket sin ruta" } -- 2.40.1 From 7d8828e6043a8e97ef28108907c7485b2fdcb822 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 31 Aug 2023 13:50:31 +0200 Subject: [PATCH 2/2] refs #6132 fix: saveSign without route --- modules/ticket/back/methods/ticket/saveSign.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ticket/back/methods/ticket/saveSign.js b/modules/ticket/back/methods/ticket/saveSign.js index 55d2e3281..9888328e7 100644 --- a/modules/ticket/back/methods/ticket/saveSign.js +++ b/modules/ticket/back/methods/ticket/saveSign.js @@ -93,6 +93,8 @@ module.exports = Self => { }, myOptions); const dmsType = await models.DmsType.findOne({where: {code: 'Ticket'}, fields: ['id']}, myOptions); const ctxUploadFile = Object.assign({}, ctx); + if (ticket.route() === null) + throw new UserError('Ticket without route'); ctxUploadFile.args = { warehouseId: ticket.warehouseFk, companyId: ticket.companyFk, -- 2.40.1