refactor(contextmenu): excludes now ensures negation
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2021-11-09 11:44:00 +01:00
parent e4ea05fd07
commit 7826897b35
1 changed files with 8 additions and 3 deletions

View File

@ -172,9 +172,14 @@ export default class Contextmenu {
excludeSelection() {
let where = {[this.fieldName]: {neq: this.fieldValue}};
if (this.exprBuilder) {
where = buildFilter(where, (param, value) =>
this.exprBuilder({param, value})
);
where = buildFilter(where, (param, value) => {
const expr = this.exprBuilder({param, value});
const props = Object.keys(expr);
const newExpr = {};
for (let prop of props)
newExpr[prop] = {neq: this.fieldValue};
return newExpr;
});
}
this.model.addFilter({where});