-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CB-5891 User - error after disabling and deleting #3056
Conversation
function onDisableUser() { | ||
userFormInfoPart.state.enabled = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we need to create disable
method in the form part and use it to disable user and sync form:
(pseudocode)
this.state.enabled = false;
await this.save()
@@ -74,6 +74,11 @@ export class UserFormInfoPart extends FormPart<IUserFormInfoState, IUserFormStat | |||
return this.loaded; | |||
} | |||
|
|||
async disableUser() { | |||
this.state.enabled = false; | |||
await this.saveChanges(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to call save
to handle update and error handling logic (for example, if the user made some changes that will not pass validation, calling saveChanges directly will skip this logic, and it also will make it possible to run multiple concurrent save requests to the backend
No description provided.