refs #6913 routeKm
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-03-12 08:25:01 +01:00
parent 99fccd1cd2
commit 6627c7a16a
1 changed files with 6 additions and 4 deletions

View File

@ -30,9 +30,11 @@ module.exports = Self => {
}); });
function validateDistance(err) { function validateDistance(err) {
const routeTotalKm = this.kmEnd - this.kmStart; if (this.kmEnd) {
const routeMaxKm = 4000; const routeTotalKm = this.kmEnd - this.kmStart;
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd) const routeMaxKm = 4000;
err(); if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
err();
}
} }
}; };