mirror of
https://github.com/bitwarden/browser
synced 2025-12-26 21:23:34 +00:00
[PM-24096] replace getOrgKey with orgKey$, refactor collectionAdminService (#15928)
* replace getOrgKey with orgKey$, refactor collectionAdminService * clean up * uncomment accidental commet * remove cache
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { CollectionAdminService, CollectionAdminView } from "@bitwarden/admin-console/common";
|
||||
import { ImportCollectionServiceAbstraction } from "@bitwarden/importer-core";
|
||||
import { UserId } from "@bitwarden/user-core";
|
||||
|
||||
@Injectable()
|
||||
export class ImportCollectionAdminService implements ImportCollectionServiceAbstraction {
|
||||
constructor(private collectionAdminService: CollectionAdminService) {}
|
||||
|
||||
async getAllAdminCollections(organizationId: string): Promise<CollectionAdminView[]> {
|
||||
return await this.collectionAdminService.getAll(organizationId);
|
||||
async getAllAdminCollections(
|
||||
organizationId: string,
|
||||
userId: UserId,
|
||||
): Promise<CollectionAdminView[]> {
|
||||
return await firstValueFrom(
|
||||
this.collectionAdminService.collectionAdminViews$(organizationId, userId),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user