From 9ee0669903ecff05ea8fa48c091cbc10da0c1cda Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 7 Feb 2024 11:27:18 +0100 Subject: [PATCH] hotfix kmMax --- loopback/locale/es.json | 2 +- modules/route/back/models/route.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 9163c494f..81bd564aa 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -139,7 +139,7 @@ "Claim state has changed to": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *{{newState}}*", "Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}", "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto", - "Distance must be lesser than 1000": "La distancia debe ser inferior a 1000", + "Distance must be lesser than 4000": "La distancia debe ser inferior a 4000", "This ticket is deleted": "Este ticket está eliminado", "Unable to clone this travel": "No ha sido posible clonar este travel", "This thermograph id already exists": "La id del termógrafo ya existe", diff --git a/modules/route/back/models/route.js b/modules/route/back/models/route.js index 9b5f3564f..48ed0a50c 100644 --- a/modules/route/back/models/route.js +++ b/modules/route/back/models/route.js @@ -21,16 +21,16 @@ module.exports = Self => { require('../methods/route/getByWorker')(Self); Self.validate('kmStart', validateDistance, { - message: 'Distance must be lesser than 1000' + message: 'Distance must be lesser than 4000' }); Self.validate('kmEnd', validateDistance, { - message: 'Distance must be lesser than 1000' + message: 'Distance must be lesser than 4000' }); function validateDistance(err) { const routeTotalKm = this.kmEnd - this.kmStart; - const routeMaxKm = 1000; + const routeMaxKm = 4000; if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd) err(); } -- 2.40.1