From 91abf2eefe7a68473b19fbf16794200fe37a03ea Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 10 Sep 2024 09:50:02 +0200 Subject: [PATCH] refactor: refs #7663 accurate error --- loopback/locale/es.json | 3 ++- modules/ticket/back/methods/ticket/setWeight.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index e9e9cd212..064ea4a95 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -373,5 +373,6 @@ "Too many records": "Demasiados registros", "Original invoice not found": "Factura original no encontrada", "The entry has no lines or does not exist": "La entrada no tiene lineas o no existe", - "Weight already set": "El peso ya está establecido" + "Weight already set": "El peso ya está establecido", + "This ticket is not allocated to your department": "Este ticket no está asignado a tu departamento" } \ No newline at end of file diff --git a/modules/ticket/back/methods/ticket/setWeight.js b/modules/ticket/back/methods/ticket/setWeight.js index 47087d384..b3b505832 100644 --- a/modules/ticket/back/methods/ticket/setWeight.js +++ b/modules/ticket/back/methods/ticket/setWeight.js @@ -59,7 +59,7 @@ module.exports = Self => { workerDepartments.length == 2 && workerDepartments[0].departmentFk != workerDepartments[1].departmentFk ) - throw new UserError('You don\'t have enough privileges'); + throw new UserError('This ticket is not allocated to your department'); } await ticket.updateAttribute('weight', weight, myOptions);