1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-25913] Fix owners unable to rename provider-managed organization (#17482)

Update to match new API: send null properties
for organization properties that are unchanged
This commit is contained in:
Thomas Rittson
2025-11-26 07:37:18 +10:00
committed by GitHub
parent 273f04c6a3
commit 63812009d7
2 changed files with 9 additions and 19 deletions

View File

@@ -168,18 +168,11 @@ export class AccountComponent implements OnInit, OnDestroy {
return;
}
const request = new OrganizationUpdateRequest();
/*
* 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;
// The server ignores any undefined values, so it's ok to reference disabled form fields here
const request: OrganizationUpdateRequest = {
name: this.formGroup.value.orgName,
billingEmail: this.formGroup.value.billingEmail,
};
// Backfill pub/priv key if necessary
if (!this.org.hasPublicAndPrivateKeys) {