Skip to content

Commit

Permalink
611 Signup validation (#647)
Browse files Browse the repository at this point in the history
* Validate emergency contact

Require at least 3 items split by a comma.

* Changed emergency contact validation
  • Loading branch information
jeffplays2005 authored Jul 20, 2024
1 parent 1e7f59e commit 0fb193e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/store/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const actions = {
}

const validateContactSection = (invalidFields: string[]) => {
const { email, confirmEmail, phone_number } = getState()
const { email, confirmEmail, phone_number, emergency_contact } =
getState()
const validRegex =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/

Expand All @@ -67,6 +68,9 @@ const actions = {
if (phone_number.toString().length < 6) {
invalidFields.push("Phone Number")
}
if (emergency_contact === "") {
invalidFields.push("Emergency Contact")
}
}

switch (pageToValidate) {
Expand Down

0 comments on commit 0fb193e

Please sign in to comment.