Use req2params middleware for datavie search endpoint

This commit is contained in:
Daniel García Aubert
2017-09-21 14:30:19 +02:00
parent 234576ab5f
commit 49204650c6
+4 -8
View File
@@ -118,6 +118,7 @@ LayergroupController.prototype.register = function(app) {
cors(),
userMiddleware,
allowQueryParams(allowedDataviewQueryParams),
this.req2paramsMiddleware,
this.dataviewSearch.bind(this)
);
@@ -126,11 +127,11 @@ LayergroupController.prototype.register = function(app) {
cors(),
userMiddleware,
allowQueryParams(allowedDataviewQueryParams),
this.req2paramsMiddleware,
this.dataviewSearch.bind(this)
);
app.get(app.base_url_mapconfig +
'/:token/analysis/node/:nodeId',
app.get(app.base_url_mapconfig + '/:token/analysis/node/:nodeId',
cors(),
userMiddleware,
this.req2paramsMiddleware,
@@ -194,12 +195,7 @@ LayergroupController.prototype.dataviewSearch = function(req, res, next) {
var self = this;
step(
function setupParams() {
self.req2params(req, res, this);
},
function searchDataview(err) {
assert.ifError(err);
function searchDataview() {
var mapConfigProvider = new MapStoreMapConfigProvider(
self.mapStore, req.context.user, self.userLimitsApi, req.params
);