Pass dataview-backend as middleware option
This commit is contained in:
parent
5e43a7145a
commit
acb9ce33b1
@ -125,7 +125,7 @@ LayergroupController.prototype.register = function(app) {
|
||||
allowQueryParams(allowedDataviewQueryParams),
|
||||
this.prepareContext,
|
||||
this.getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
|
||||
this.getDataview()
|
||||
this.getDataview(this.dataviewBackend)
|
||||
);
|
||||
|
||||
app.get(
|
||||
@ -135,7 +135,7 @@ LayergroupController.prototype.register = function(app) {
|
||||
allowQueryParams(allowedDataviewQueryParams),
|
||||
this.prepareContext,
|
||||
this.getMapStoreMapConfigProvider(this.mapStore, this.userLimitsApi),
|
||||
this.getDataview()
|
||||
this.getDataview(this.dataviewBackend)
|
||||
);
|
||||
|
||||
app.get(
|
||||
@ -198,11 +198,11 @@ LayergroupController.prototype.getMapStoreMapConfigProvider = function (mapStore
|
||||
};
|
||||
};
|
||||
|
||||
LayergroupController.prototype.getDataview = function () {
|
||||
LayergroupController.prototype.getDataview = function (dataviewBackend) {
|
||||
return function getDataviewMiddleware (req, res, next) {
|
||||
const { user, mapConfigProvider } = res.locals;
|
||||
|
||||
this.dataviewBackend.getDataview(mapConfigProvider, user, res.locals, (err, dataview, stats) => {
|
||||
dataviewBackend.getDataview(mapConfigProvider, user, res.locals, (err, dataview, stats) => {
|
||||
req.profiler.add(stats || {});
|
||||
|
||||
if (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user