From d2b5eaa8c334923c6bd0442573b94790ae145eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 2 Nov 2017 10:28:33 +0100 Subject: [PATCH] Do not proxy create and intantiate middlewares --- lib/cartodb/controllers/map.js | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index a50bc72e..72d597a1 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -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;