1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

Add default OrganizationUpdateRequest values when FormControls are disabled (#9774)

This commit is contained in:
Alex Morask 2024-06-25 10:45:21 -04:00 committed by GitHub
parent a0e00f9519
commit b6c46745a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -153,8 +153,17 @@ export class AccountComponent {
}
const request = new OrganizationUpdateRequest();
request.name = this.formGroup.value.orgName;
request.billingEmail = this.formGroup.value.billingEmail;
/*
* When you disable a FormControl, it is removed from formGroup.values, so we have to use
* the original value.
* */
request.name = this.formGroup.get("orgName").disabled
? this.org.name
: this.formGroup.value.orgName;
request.billingEmail = this.formGroup.get("billingEmail").disabled
? this.org.billingEmail
: this.formGroup.value.billingEmail;
// Backfill pub/priv key if necessary
if (!this.org.hasPublicAndPrivateKeys) {