mirror of https://github.com/pelias/api.git
Stephen Hess
8 years ago
2 changed files with 6 additions and 4 deletions
@ -1,7 +1,9 @@ |
|||||||
const _ = require('lodash'); |
const _ = require('lodash'); |
||||||
|
|
||||||
|
const non_coarse_layers = ['address', 'street', 'venue']; |
||||||
|
|
||||||
module.exports = (req, res) => { |
module.exports = (req, res) => { |
||||||
// returns true if layers is undefined, empty, or contains 'address' or 'venue'
|
// returns true if layers is undefined, empty, or contains 'address', 'street', or 'venue'
|
||||||
return !_.isEmpty(req.clean.layers) && |
return !_.isEmpty(req.clean.layers) && |
||||||
_.intersection(req.clean.layers, ['address', 'venue']).length === 0; |
_.intersection(req.clean.layers, non_coarse_layers).length === 0; |
||||||
}; |
}; |
||||||
|
Loading…
Reference in new issue