Skip to content
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

Merged
merged 5 commits into from
Nov 11, 2024

Conversation

sergeyteleshev
Copy link
Contributor

No description provided.

Comment on lines 62 to 64
function onDisableUser() {
userFormInfoPart.state.enabled = false;
}
Copy link
Member

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

@sergeyteleshev sergeyteleshev requested a review from Wroud November 7, 2024 11:09
@@ -74,6 +74,11 @@ export class UserFormInfoPart extends FormPart<IUserFormInfoState, IUserFormStat
return this.loaded;
}

async disableUser() {
this.state.enabled = false;
await this.saveChanges();
Copy link
Member

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

@sergeyteleshev sergeyteleshev requested a review from Wroud November 7, 2024 16:31
@Wroud Wroud merged commit 3b9275c into devel Nov 11, 2024
6 of 7 checks passed
@Wroud Wroud deleted the CB-5891-user-error-after-disabling-and-deleting branch November 11, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants