Place function closer to where is called

This commit is contained in:
Daniel García Aubert
2018-03-06 16:21:46 +01:00
parent 585b5929aa
commit 3695e1e3e5

View File

@@ -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();
}