1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 19:53:43 +00:00

[PS-1093] Move Organization Api Calls (#3243)

* Move organization api calls into seperate service

* Remove unneeded unknown

* Address PR feedback
This commit is contained in:
Justin Baur
2022-08-24 12:33:05 -04:00
committed by GitHub
parent 364d2f311e
commit 7145b13df1
39 changed files with 545 additions and 414 deletions

View File

@@ -6,6 +6,7 @@ import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/abstractions/organization/organization-api.service.abstraction";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { SyncService } from "@bitwarden/common/abstractions/sync.service";
import { UserVerificationService } from "@bitwarden/common/abstractions/userVerification/userVerification.service.abstraction";
@@ -33,7 +34,8 @@ export class EnrollMasterPasswordReset {
private syncService: SyncService,
private logService: LogService,
private modalRef: ModalRef,
config: ModalConfig
config: ModalConfig,
private organizationApiService: OrganizationApiServiceAbstraction
) {
this.organization = config.data.organization;
}
@@ -48,7 +50,7 @@ export class EnrollMasterPasswordReset {
let keyString: string = null;
// Retrieve Public Key
const orgKeys = await this.apiService.getOrganizationKeys(this.organization.id);
const orgKeys = await this.organizationApiService.getKeys(this.organization.id);
if (orgKeys == null) {
throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));
}