fix save button validation
This commit is contained in:
1 parent
c5bbb7aa2c
commit
5159d43cad
2 files changed
+6
-2
No files matched your search
@@ -34,7 +34,11 @@ const ChangePasswordModal = ({ isSaving, isLoading, changePassword, email }) =>
|
||||
|
||||
handlePasswordFeedback(updatedForm, name, value, form, errors, setErrors);
|
||||
};
|
||||
const isFormValid = !errors.password && !errors.confirm;
|
||||
const isFormValid =
|
||||
form.password.length > 1 &&
|
||||
form.confirm.length > 1 &&
|
||||
!errors.password &&
|
||||
!errors.confirm;
|
||||
const onsubmitChangePassword = async (event) => {
|
||||
event.preventDefault();
|
||||
if (!isFormValid) return;
|
||||
@@ -57,6 +61,7 @@ const ChangePasswordModal = ({ isSaving, isLoading, changePassword, email }) =>
|
||||
setIsLoadingSubmit(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
|
||||
@@ -467,7 +467,6 @@ class AuthController extends BaseController {
|
||||
|
||||
const userId = req.params.userId;
|
||||
const updates = { ...req.body };
|
||||
console.log("body", req.body);
|
||||
await editUserByIdParamValidation.validateAsync(req.params);
|
||||
await editUserPasswordByIdBodyValidation.validateAsync(req.body);
|
||||
await this.userService.setPasswordByUserId(userId, updates);
|
||||
|
||||
Reference in new issue
Block a user