Skip to content

Commit

Permalink
Also return empty array if error.
Browse files Browse the repository at this point in the history
  • Loading branch information
valurefugl committed Sep 19, 2024
1 parent 80ca07c commit 562f5c2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions libs/auth-api-lib/src/lib/delegations/delegation-scope.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,19 @@ export class DelegationScopeService {
`Failed checking if delegation exists at provider '${AuthDelegationProvider.DistrictCommissionersRegistry}'`,
)
}
if (!delegationFound && !isError) {
Promise.all(
delegationTypes.map((dt) =>
this.delegationsIndexService.removeDelegationRecord({
fromNationalId,
toNationalId,
type: dt as AuthDelegationType,
provider: AuthDelegationProvider.DistrictCommissionersRegistry,
}),
),
)
if (!delegationFound) {
if (!isError) {
Promise.all(
delegationTypes.map((dt) =>
this.delegationsIndexService.removeDelegationRecord({
fromNationalId,
toNationalId,
type: dt as AuthDelegationType,
provider: AuthDelegationProvider.DistrictCommissionersRegistry,
}),
),
)
}
return []
}

Expand Down

0 comments on commit 562f5c2

Please sign in to comment.