1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +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; return;
} }
const request = new OrganizationUpdateRequest(); // The server ignores any undefined values, so it's ok to reference disabled form fields here
const request: OrganizationUpdateRequest = {
/* name: this.formGroup.value.orgName,
* When you disable a FormControl, it is removed from formGroup.values, so we have to use billingEmail: this.formGroup.value.billingEmail,
* 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 // Backfill pub/priv key if necessary
if (!this.org.hasPublicAndPrivateKeys) { if (!this.org.hasPublicAndPrivateKeys) {

View File

@@ -1,10 +1,7 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { OrganizationKeysRequest } from "./organization-keys.request"; import { OrganizationKeysRequest } from "./organization-keys.request";
export class OrganizationUpdateRequest { export interface OrganizationUpdateRequest {
name: string; name?: string;
businessName: string; billingEmail?: string;
billingEmail: string; keys?: OrganizationKeysRequest;
keys: OrganizationKeysRequest;
} }