mirror of
https://github.com/bitwarden/web
synced 2026-01-04 09:33:32 +00:00
Add owner email to provider org creation (#1101)
* Add owner email to provider org creation * Use Correct request model * Update jslib * Remove unused input * Remove unused input * Improve client owner email description
This commit is contained in:
@@ -34,6 +34,7 @@ import { ProductType } from 'jslib-common/enums/productType';
|
||||
import { OrganizationCreateRequest } from 'jslib-common/models/request/organizationCreateRequest';
|
||||
import { OrganizationKeysRequest } from 'jslib-common/models/request/organizationKeysRequest';
|
||||
import { OrganizationUpgradeRequest } from 'jslib-common/models/request/organizationUpgradeRequest';
|
||||
import { ProviderOrganizationCreateRequest } from 'jslib-common/models/request/provider/providerOrganizationCreateRequest';
|
||||
|
||||
import { PlanResponse } from 'jslib-common/models/response/planResponse';
|
||||
|
||||
@@ -62,6 +63,7 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
additionalSeats: number = 0;
|
||||
name: string;
|
||||
billingEmail: string;
|
||||
clientOwnerEmail: string;
|
||||
businessName: string;
|
||||
productTypes = ProductType;
|
||||
formPromise: Promise<any>;
|
||||
@@ -336,9 +338,12 @@ export class OrganizationPlansComponent implements OnInit {
|
||||
}
|
||||
|
||||
if (this.providerId) {
|
||||
const providerRequest = new ProviderOrganizationCreateRequest(this.clientOwnerEmail, request);
|
||||
const providerKey = await this.cryptoService.getProviderKey(this.providerId);
|
||||
request.key = (await this.cryptoService.encrypt(orgKey.key, providerKey)).encryptedString;
|
||||
return (await this.apiService.postProviderCreateOrganization(this.providerId, request)).id;
|
||||
providerRequest.organizationCreateRequest.key = (await this.cryptoService.encrypt(orgKey.key, providerKey)).encryptedString;
|
||||
const orgId = (await this.apiService.postProviderCreateOrganization(this.providerId, providerRequest)).organizationId;
|
||||
|
||||
return orgId;
|
||||
} else {
|
||||
return (await this.apiService.postOrganization(request)).id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user