Skip to content

Commit

Permalink
Set properties to null if no value provided
Browse files Browse the repository at this point in the history
  • Loading branch information
manelcecs committed Jan 3, 2024
1 parent db95733 commit 422c48b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/domain-services/flows/flow-search-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit 422c48b

Please sign in to comment.