fix /stations coordinates filter 🐛

closes #13
This commit is contained in:
Jannis R 2020-01-31 15:00:47 +01:00
parent 6b514ecb72
commit 81cbb6fd84
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -40,10 +40,11 @@ const filter = (req, res, next) => {
const selector = Object.create(null)
for (let prop in req.query) {
const val = parse(req.query[prop])
if (prop.slice(0, 12) === 'coordinates.') { // derhuerst/db-rest#2
prop = 'location.' + prop.slice(12)
}
selector[prop] = parse(req.query[prop])
selector[prop] = val
}
const filter = createFilter(selector)