From 81cbb6fd843153aaaacbd69a971b93add8988867 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 31 Jan 2020 15:00:47 +0100 Subject: [PATCH] fix /stations coordinates filter :bug: closes #13 --- lib/stations.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stations.js b/lib/stations.js index ceebdfc..4403bef 100644 --- a/lib/stations.js +++ b/lib/stations.js @@ -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)