mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-25 03:09:32 -06:00
fix save button validation
This commit is contained in:
@@ -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