diff --git a/src/domain-services/flows/flow-search-service.ts b/src/domain-services/flows/flow-search-service.ts index 36fbc4e8..87015737 100644 --- a/src/domain-services/flows/flow-search-service.ts +++ b/src/domain-services/flows/flow-search-service.ts @@ -76,10 +76,9 @@ export class FlowSearchService { const orderBy: FlowOrderBy = this.buildOrderBy(sortField, sortOrder); - const { - flowFilters, - flowObjectFilters, - flowCategoryFilters, + const { flowFilters, flowObjectFilters, flowCategoryFilters } = filters; + + let { pending: isPendingFlows, commitment: isCommitmentFlows, paid: isPaidFlows, @@ -90,6 +89,16 @@ export class FlowSearchService { standard: isStandardFlows, } = filters; + // plain map from undefined to null + isPendingFlows = isPendingFlows ?? null; + isCommitmentFlows = isCommitmentFlows ?? null; + isPaidFlows = isPaidFlows ?? null; + isPledgedFlows = isPledgedFlows ?? null; + isCarryoverFlows = isCarryoverFlows ?? null; + isParkedFlows = isParkedFlows ?? null; + isPassThroughFlows = isPassThroughFlows ?? null; + isStandardFlows = isStandardFlows ?? null; + // Once we've gathered all the filters, we need to determine the strategy // to use in order to obtain the flowIDs const strategy: FlowSearchStrategy = this.determineStrategy(