Pass only needed params to dataview backend

This commit is contained in:
Daniel García Aubert
2018-03-22 17:55:15 +01:00
parent 258d768887
commit 2812a54210
+4 -1
View File
@@ -456,7 +456,10 @@ function createMapStoreMapConfigProvider (
function getDataview (dataviewBackend) {
return function getDataviewMiddleware (req, res, next) {
const { user, mapConfigProvider } = res.locals;
const params = getRequestParams(res.locals);
const { dataviewName } = req.params;
const { dbuser, dbname, dbpassword, dbhost, dbport } = res.locals;
const params = Object.assign({ dataviewName, dbuser, dbname, dbpassword, dbhost, dbport }, req.query);
dataviewBackend.getDataview(mapConfigProvider, user, params, (err, dataview, stats = {}) => {
req.profiler.add(stats);