Pass only needed params to dataview backend (search)

This commit is contained in:
Daniel García Aubert
2018-03-22 18:03:38 +01:00
parent 2812a54210
commit 81706b8726
+5 -2
View File
@@ -478,8 +478,11 @@ function getDataview (dataviewBackend) {
function dataviewSearch (dataviewBackend) {
return function dataviewSearchMiddleware (req, res, next) {
const { user, dataviewName, mapConfigProvider } = res.locals;
const params = getRequestParams(res.locals);
const { user, mapConfigProvider } = res.locals;
const { dataviewName } = req.params;
const { dbuser, dbname, dbpassword, dbhost, dbport } = res.locals;
const params = Object.assign({ dbuser, dbname, dbpassword, dbhost, dbport }, req.query);
dataviewBackend.search(mapConfigProvider, user, dataviewName, params, (err, searchResult, stats = {}) => {
req.profiler.add(stats);