mirror of https://github.com/pelias/api.git
Julian Simioni
9 years ago
3 changed files with 3 additions and 29 deletions
@ -1,18 +0,0 @@ |
|||||||
/** |
|
||||||
* Take the layers specified by the layers parameter and use them to set the |
|
||||||
* list of Elasticsearch types to filter. |
|
||||||
* |
|
||||||
* This has to be done outside the layers sanitizer since it doesn't know that |
|
||||||
* the layers property is eventualy used to choose the _type. |
|
||||||
*/ |
|
||||||
function middleware(req, res, next) { |
|
||||||
req.clean = req.clean || {}; |
|
||||||
|
|
||||||
if (req.clean.hasOwnProperty('layers')) { |
|
||||||
req.clean.type = req.clean.layers; |
|
||||||
} |
|
||||||
|
|
||||||
next(); |
|
||||||
} |
|
||||||
|
|
||||||
module.exports = middleware; |
|
Loading…
Reference in new issue