Skip to content

Commit

Permalink
fix: make code cleaner with optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
naftis committed Sep 13, 2023
1 parent 12a5efc commit 810bd8f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/dci-opencrvs-bridge/src/dci-to-opencrvs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ export function searchRequestToAdvancedSearchParameters(
throw new ParseError('Unsupported identifier type')
}

parameters.event =
request.search_criteria.reg_event_type !== undefined
? request.search_criteria.reg_event_type.value
: undefined
parameters.event = request.search_criteria.reg_event_type?.value

if ((sort?.length ?? 0) > 1) {
throw new ParseError('Sorting by more than one attribute is not supported')
Expand Down

0 comments on commit 810bd8f

Please sign in to comment.