mirror of
https://github.com/bitwarden/browser
synced 2026-03-01 19:11:22 +00:00
Update Organization and Policy Services to allow the passing of a user id and to prevent hangs waiting on an active user (#8712)
* OrgSvc - add new observable returning getAll$ method which accepts a required user id * OrgSvc - make user id optional * PolicySvc - getAll$ should use the new OrgSvc.getAll$ method so that it doesn't hang if there isn't an active user yet but a user id was passed in. * Fix policy service tests
This commit is contained in:
@@ -73,6 +73,10 @@ export class OrganizationService implements InternalOrganizationServiceAbstracti
|
||||
return this.organizations$.pipe(mapToSingleOrganization(id));
|
||||
}
|
||||
|
||||
getAll$(userId?: UserId): Observable<Organization[]> {
|
||||
return this.getOrganizationsFromState$(userId);
|
||||
}
|
||||
|
||||
async getAll(userId?: string): Promise<Organization[]> {
|
||||
return await firstValueFrom(this.getOrganizationsFromState$(userId as UserId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user