Skip to content

Commit 51b13fb

Browse files
Fix AuthorizationDataService.isAuthorized throwing a console error when the searchByObject request doesn't succeed
1 parent 987a92f commit 51b13fb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/app/core/data/feature-authorization/authorization-data.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class AuthorizationDataService extends BaseDataService<Authorization> imp
7474
return [];
7575
}
7676
}),
77-
catchError(() => observableOf(false)),
77+
catchError(() => observableOf([])),
7878
oneAuthorizationMatchesFeature(featureId)
7979
);
8080
}

src/app/core/data/feature-authorization/authorization-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ export const oneAuthorizationMatchesFeature = (featureID: FeatureID) =>
6868
source.pipe(
6969
switchMap((authorizations: Authorization[]) => {
7070
if (isNotEmpty(authorizations)) {
71-
return observableCombineLatest(
71+
return observableCombineLatest([
7272
...authorizations
7373
.filter((authorization: Authorization) => hasValue(authorization.feature))
7474
.map((authorization: Authorization) => authorization.feature.pipe(
7575
getFirstSucceededRemoteDataPayload()
7676
))
77-
);
77+
]);
7878
} else {
7979
return observableOf([]);
8080
}

0 commit comments

Comments
 (0)