From 721b3ab6107aa628398b2aa4bf07e4e4330a3631 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 29 Oct 2024 12:56:41 +0000 Subject: [PATCH] Account for logicalOperator inside UISearchFilter groups --- packages/shared-core/src/filters.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/shared-core/src/filters.ts b/packages/shared-core/src/filters.ts index 003e6b5082..7720fe2b8d 100644 --- a/packages/shared-core/src/filters.ts +++ b/packages/shared-core/src/filters.ts @@ -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) }, }