Skip to content

Commit

Permalink
review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 13, 2024
1 parent 91b9bbc commit d79c335
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pages/register/IndyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const IndyForm: FC<IndyFormProps> = () => {
password_repeat: "",
}}
onSubmit={submitForm(createIndependentUser, {
exclude: ["password_repeat"],
exclude: ["password_repeat", "meets_criteria"],
then: () => {
navigate(paths.register.emailVerification.userType.indy._)
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/register/TeacherForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const TeacherForm: FC<TeacherFormProps> = () => {
},
}}
onSubmit={submitForm(createTeacher, {
exclude: ["user.password_repeat"],
exclude: ["user.password_repeat", "user.meets_criteria"],
then: () => {
navigate(paths.register.emailVerification.userType.teacher._)
},
Expand Down
6 changes: 3 additions & 3 deletions src/pages/studentAccount/UpdateAccountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ const UpdateAccountForm: FC<UpdateAccountFormProps> = ({ user }) => {
const messages = [
"Your account details have been changed successfully.",
]
if (values.email !== initialValues.email) {
if (isDirty(values, initialValues, "email")) {
// TODO: implement this behavior on the backend.
messages.push(
"Your email will be changed once you have verified it, until then you can still log in with your old email.",
)
}
if (values.password !== initialValues.password) {
if (isDirty(values, initialValues, "password")) {
messages.push(
"Going forward, please login using your new password.",
)
Expand All @@ -122,7 +122,7 @@ const UpdateAccountForm: FC<UpdateAccountFormProps> = ({ user }) => {
let passwordSchema = user.student
? studentPasswordSchema()
: indyPasswordSchema()
if (form.values.current_password !== initialValues.current_password) {
if (isDirty(form.values, initialValues, "current_password")) {
passwordSchema = passwordSchema.notOneOf(
[form.values.current_password],
"cannot match your current password",
Expand Down

0 comments on commit d79c335

Please sign in to comment.