mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
[EC-859] update billing routes for owners of Managed orgs (#4611)
* [EC-859] update billing routes for owners of Managed orgs * [EC-859] fix observable in billing tab * [EC-859] update observable name * [EC-859] update reporting and settings observables * [EC-859] add startsWith to reporting observable * [EC-859] async pipe once in settings * [EC-859] create get$ in org service * [EC-859] transition remaining components * [EC-859] add as org to template * [EC-859] add shareReplay to observable to prevent multicasting - future proof get$ on org service * [AC-859] fix missed org
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { BehaviorSubject, concatMap } from "rxjs";
|
||||
import { BehaviorSubject, concatMap, map, Observable } from "rxjs";
|
||||
|
||||
import { InternalOrganizationService as InternalOrganizationServiceAbstraction } from "../../abstractions/organization/organization.service.abstraction";
|
||||
import { StateService } from "../../abstractions/state.service";
|
||||
@@ -26,6 +26,10 @@ export class OrganizationService implements InternalOrganizationServiceAbstracti
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
get$(id: string): Observable<Organization | undefined> {
|
||||
return this.organizations$.pipe(map((orgs) => orgs.find((o) => o.id === id)));
|
||||
}
|
||||
|
||||
async getAll(userId?: string): Promise<Organization[]> {
|
||||
const organizationsMap = await this.stateService.getOrganizations({ userId: userId });
|
||||
return Object.values(organizationsMap || {}).map((o) => new Organization(o));
|
||||
|
||||
Reference in New Issue
Block a user