hotfix kmMax #2003
|
@ -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",
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue