Skip to content

Commit

Permalink
New set of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Sep 7, 2020
1 parent 8fe7ba3 commit b2293d4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions js/data/model.js
Expand Up @@ -441,7 +441,6 @@ export class ModelStore extends Model {
// that previous value in a join statement according to
// the currently defined operator
const filterP = params[name];

if (filterP || operator) {
// defaults the operator for the join of the names to the
// value and then ensures that the value of the operator
Expand All @@ -455,15 +454,22 @@ export class ModelStore extends Model {
// and updates the name value to the and value
const filterA = params[_operator] || [];

const newFilter = {};
newFilter[name] = filter;
filterA.push(newFilter);
// builds the filter object assigned to the name of the
// variable and adds to the list of values
const _filter = {};
_filter[name] = filter;
filterA.push(_filter);

// in case there's a previous filter also adds it to the
// list of filter values
if (filterP) {
const newFilterP = {};
newFilterP[name] = filterP;
filterA.push(newFilterP);
const _filterP = {};
_filterP[name] = filterP;
filterA.push(_filterP);
}

// updates the filter reference and updates the operator
// name (as expected)
filter = filterA;
delete params[name];
name = _operator;
Expand Down

0 comments on commit b2293d4

Please sign in to comment.