1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00: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

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) {