Extract getAffectedTables middleware from controller's context
This commit is contained in:
@@ -52,7 +52,7 @@ NamedMapsController.prototype.register = function(app) {
|
||||
userMiddleware(),
|
||||
this.prepareContext,
|
||||
getNamedMapProvider(tileOptions),
|
||||
this.getAffectedTables(),
|
||||
getAffectedTables(),
|
||||
this.getTile(tileOptions),
|
||||
this.setSurrogateKey(),
|
||||
this.setCacheChannelHeader(),
|
||||
@@ -76,7 +76,7 @@ NamedMapsController.prototype.register = function(app) {
|
||||
allowQueryParams(['layer', 'zoom', 'lon', 'lat', 'bbox']),
|
||||
this.prepareContext,
|
||||
getNamedMapProvider(staticOptions),
|
||||
this.getAffectedTables(),
|
||||
getAffectedTables(),
|
||||
this.getTemplate(staticOptions),
|
||||
this.prepareLayerFilterFromPreviewLayers(staticOptions),
|
||||
this.getStaticImageOptions(),
|
||||
@@ -117,7 +117,7 @@ function getNamedMapProvider ({ namedMapProviderCache, label, forcedFormat = nul
|
||||
};
|
||||
};
|
||||
|
||||
NamedMapsController.prototype.getAffectedTables = function () {
|
||||
function getAffectedTables () {
|
||||
return function getAffectedTables (req, res, next) {
|
||||
const { namedMapProvider } = res.locals;
|
||||
|
||||
@@ -132,7 +132,7 @@ NamedMapsController.prototype.getAffectedTables = function () {
|
||||
|
||||
next();
|
||||
});
|
||||
}.bind(this);
|
||||
};
|
||||
};
|
||||
|
||||
NamedMapsController.prototype.getTemplate = function ({ label }) {
|
||||
|
||||
Reference in New Issue
Block a user