mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
rewrite Filter._getMongoSelecto to not include Empty Filter.
This commit is contained in:
parent
4ff8989e8f
commit
39974c9532
1 changed files with 10 additions and 12 deletions
|
@ -248,18 +248,16 @@ Filter = {
|
|||
|
||||
const exceptionsSelector = {_id: {$in: this._exceptions}};
|
||||
this._exceptionsDep.depend();
|
||||
console.log("Final Filter:");
|
||||
console.log({
|
||||
$or: [filterSelector, exceptionsSelector, this.advanced._getMongoSelector()],
|
||||
});
|
||||
if (includeEmptySelectors)
|
||||
return {
|
||||
$or: [filterSelector, exceptionsSelector, this.advanced._getMongoSelector(), emptySelector],
|
||||
};
|
||||
else
|
||||
return {
|
||||
$or: [filterSelector, exceptionsSelector, this.advanced._getMongoSelector()],
|
||||
};
|
||||
|
||||
const selectors = [exceptionsSelector];
|
||||
|
||||
if (_.any(this._fields, (fieldName) => {
|
||||
return this[fieldName]._isActive();
|
||||
})) selectors.push(filterSelector);
|
||||
if (includeEmptySelectors) selectors.push(emptySelector);
|
||||
if (this.advanced._isActive()) selectors.push(this.advanced._getMongoSelector());
|
||||
|
||||
return {$or: selectors};
|
||||
},
|
||||
|
||||
mongoSelector(additionalSelector) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue