res.locals forgotten things and make jshint happy
This commit is contained in:
@@ -177,7 +177,13 @@ LayergroupController.prototype.dataview = function(req, res, next) {
|
||||
var mapConfigProvider = new MapStoreMapConfigProvider(
|
||||
self.mapStore, req.context.user, self.userLimitsApi, res.locals
|
||||
);
|
||||
self.dataviewBackend.getDataview(mapConfigProvider, req.context.user, req.params.dataviewName, res.locals, this);
|
||||
self.dataviewBackend.getDataview(
|
||||
mapConfigProvider,
|
||||
req.context.user,
|
||||
req.params.dataviewName,
|
||||
res.locals,
|
||||
this
|
||||
);
|
||||
},
|
||||
function finish(err, dataview, stats) {
|
||||
req.profiler.add(stats || {});
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
const _ = require('underscore');
|
||||
|
||||
module.exports = function authorizeMiddleware (authApi) {
|
||||
return function (req, res, next) {
|
||||
req.profiler.done('req2params.setup');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const locals = require('./locals')
|
||||
const locals = require('./locals');
|
||||
const cleanUpQueryParams = require('./clean-up-query-params');
|
||||
const layergroupToken = require('./layergroup-token');
|
||||
const authorize = require('./authorize');
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
const _ = require('underscore');
|
||||
|
||||
module.exports = function layergroupTokenMiddleware(req, res, next) {
|
||||
// FIXME: Temporary hack to share data between middlewares. Express overrides req.params to
|
||||
// parse url params to an object and it's performed after matching path and controller.
|
||||
res.locals = {};
|
||||
_.extend(res.locals, req.params);
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user