Do not proxy create and intantiate middlewares

This commit is contained in:
Daniel García Aubert 2017-11-02 10:28:33 +01:00
parent eb5bf52bd9
commit d2b5eaa8c3

View File

@ -59,7 +59,7 @@ MapController.prototype.register = function(app) {
createGetPrepareConfig,
this.prepareAdapterMapConfig.bind(this),
this.createLayergroup.bind(this),
this.createGet.bind(this),
this.create.bind(this),
respond,
mapErrorMiddleware({
label: 'ANONYMOUS LAYERGROUP',
@ -74,7 +74,7 @@ MapController.prototype.register = function(app) {
createPostPrepareConfig,
this.prepareAdapterMapConfig.bind(this),
this.createLayergroup.bind(this),
this.createPost.bind(this),
this.create.bind(this),
respond,
mapErrorMiddleware({
label: 'ANONYMOUS LAYERGROUP',
@ -89,7 +89,7 @@ MapController.prototype.register = function(app) {
prepareJsonTemplateParams,
this.getTemplate.bind(this),
this.createLayergroupFromTemplate.bind(this),
this.jsonp.bind(this),
this.instantiateTemplate.bind(this),
respond,
mapErrorMiddleware({
label: 'NAMED MAP LAYERGROUP'
@ -103,7 +103,7 @@ MapController.prototype.register = function(app) {
prepareTemplateParams,
this.getTemplate.bind(this),
this.createLayergroupFromTemplate.bind(this),
this.instantiate.bind(this),
this.instantiateTemplate.bind(this),
respond,
mapErrorMiddleware({
label: 'NAMED MAP LAYERGROUP'
@ -170,22 +170,6 @@ function prepareJsonTemplateParams(req, res, next) {
return next();
}
MapController.prototype.createGet = function(req, res, next){
this.create(req, res, next);
};
MapController.prototype.createPost = function(req, res, next) {
this.create(req, res, next);
};
MapController.prototype.instantiate = function(req, res, next) {
this.instantiateTemplate(req, res, next);
};
MapController.prototype.jsonp = function(req, res, next) {
this.instantiateTemplate(req, res, next);
};
MapController.prototype.prepareAdapterMapConfig = function (req, res, next) {
const requestMapConfig = req.body;
const { user, dbhost, dbport, dbname, dbuser, dbpassword, api_key } = res.locals;