fix /stations coordinates filter again 🐛

fixes #13 again
This commit is contained in:
Jannis R 2020-01-31 16:33:42 +01:00
parent 81cbb6fd84
commit 881af824e0
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

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