ceil to floor for map min and max

This commit is contained in:
Integral Team 2019-09-11 16:05:26 +07:00
parent 4416fa5d64
commit 6f40f29d84
3 changed files with 485 additions and 1 deletions

View file

@ -51,7 +51,7 @@ module.exports = async (req, res) => {
list = list.filter(item => !author || (item.owner && item.owner._id === author));
let limits = list.reduce(({ min, max }, { distance: dist }) => ({
min: Math.ceil(Math.min(dist, min) / 25) * 25,
min: Math.floor(Math.min(dist, min) / 25) * 25,
max: Math.ceil(Math.max(dist, max) / 25) * 25,
}), { min: 999999, max: 0 });