From 3695e1e3e54b573db609d0cf3aee7d0aed55fd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 6 Mar 2018 16:21:46 +0100 Subject: [PATCH] Place function closer to where is called --- lib/cartodb/controllers/layergroup.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/cartodb/controllers/layergroup.js b/lib/cartodb/controllers/layergroup.js index e07ba56b..0e706b1d 100644 --- a/lib/cartodb/controllers/layergroup.js +++ b/lib/cartodb/controllers/layergroup.js @@ -175,6 +175,14 @@ LayergroupController.prototype.register = function(app) { ); }; +function validateLayerRouteMiddleware(req, res, next) { + if (req.params.token === 'static') { + return next('route'); + } + + next(); +} + LayergroupController.prototype.analysisNodeStatus = function (analysisStatusBackend) { return function analysisNodeStatusMiddleware(req, res, next) { analysisStatusBackend.getNodeStatus(res.locals, (err, nodeStatus, stats) => { @@ -537,12 +545,3 @@ LayergroupController.prototype.getAffectedTables = function(user, dbName, layerg callback ); }; - - -function validateLayerRouteMiddleware(req, res, next) { - if (req.params.token === 'static') { - return next('route'); - } - - next(); -}