Extract variable
This commit is contained in:
@@ -19,6 +19,8 @@ module.exports = DataviewBackend;
|
||||
DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, params, callback) {
|
||||
var timer = new Timer();
|
||||
|
||||
var dataviewName = params.dataviewName;
|
||||
|
||||
var mapConfig;
|
||||
var dataviewDefinition;
|
||||
step(
|
||||
@@ -30,9 +32,9 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
|
||||
|
||||
mapConfig = _mapConfig;
|
||||
|
||||
var _dataviewDefinition = getDataviewDefinition(mapConfig.obj(), params.dataviewName);
|
||||
var _dataviewDefinition = getDataviewDefinition(mapConfig.obj(), dataviewName);
|
||||
if (!_dataviewDefinition) {
|
||||
throw new Error("Dataview '" + params.dataviewName + "' does not exists");
|
||||
throw new Error("Dataview '" + dataviewName + "' does not exists");
|
||||
}
|
||||
|
||||
dataviewDefinition = _dataviewDefinition;
|
||||
@@ -102,7 +104,7 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
|
||||
query = node.getQuery();
|
||||
} else {
|
||||
var applyFilters = {};
|
||||
applyFilters[params.dataviewName] = false;
|
||||
applyFilters[dataviewName] = false;
|
||||
query = node.getQuery(applyFilters);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user