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:
@@ -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) {
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user