Account for logicalOperator inside UISearchFilter groups

This commit is contained in:
Andrew Kingston 2024-10-29 12:56:41 +00:00
parent 336bd9730a
commit 721b3ab610
No known key found for this signature in database
1 changed files with 7 additions and 1 deletions

View File

@ -488,7 +488,13 @@ export function buildQuery(
if (onEmptyFilter) {
query.onEmptyFilter = onEmptyFilter
}
const operator = allOr ? LogicalOperator.OR : LogicalOperator.AND
// logicalOperator takes precendence over allOr
let operator = allOr ? LogicalOperator.OR : LogicalOperator.AND
if (group.logicalOperator) {
operator = logicalOperatorFromUI(group.logicalOperator)
}
return {
[operator]: { conditions: filters.map(buildCondition).filter(f => f) },
}