Skip to content

Commit

Permalink
fixing some backend tests and validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurikam2003 committed Jul 29, 2024
1 parent 17a8752 commit 3e63146
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ const PageProfileEditUnregistered = () => {
errorsCopy['phoneNumber'] = 'Please enter a phone number';
anyErrorsNow = true;
}
if (accountObj['phoneNumberCountryCode'] === undefined || accountObj['phoneNumberCountryCode'] === '') {
errorsCopy['phoneNumberCountryCode'] = 'Please enter a country code';
anyErrorsNow = true;
} else if (!/^[+0-9]*$/.test(accountObj['phoneNumberCountryCode'])) {
if (!/^[+0-9]*$/.test(accountObj['phoneNumberCountryCode'])) {
errorsCopy['phoneNumberCountryCode'] = 'Must contain characters 0-9 or +';
anyErrorsNow = true;
} else if (accountObj['phoneNumberCountryCode'].length > 4) {
Expand All @@ -138,21 +135,15 @@ const PageProfileEditUnregistered = () => {
errorsCopy['emergencyContactName'] = 'Please try to use 50 characters or less';
anyErrorsNow = true;
}
if (accountObj['emergencyContactRelationship'] === undefined || accountObj['emergencyContactRelationship'] === '') {
errorsCopy['emergencyContactRelationship'] = 'Please enter an emergency contact relationship';
anyErrorsNow = true;
} else if (accountObj['emergencyContactName'].length > 50) {
errorsCopy['emergencyContactName'] = 'Please try to use 50 characters or less';
if (accountObj['emergencyContactRelationship'].length > 50) {
errorsCopy['emergencyContactRelationship'] = 'Please try to use 50 characters or less';
anyErrorsNow = true;
}
if (accountObj['emergencyContactNumber'] === undefined || accountObj['emergencyContactNumber'] === '') {
errorsCopy['emergencyContactNumber'] = 'Please enter a phone number';
anyErrorsNow = true;
}
if (accountObj['emergencyContactCountryCode'] === undefined || accountObj['emergencyContactCountryCode'] === '') {
errorsCopy['emergencyContactCountryCode'] = 'Please enter a country code';
anyErrorsNow = true;
} else if (!/^[+0-9]*$/.test(accountObj['emergencyContactCountryCode'])) {
if (!/^[+0-9]*$/.test(accountObj['emergencyContactCountryCode'])) {
errorsCopy['emergencyContactCountryCode'] = 'Must contain characters 0-9 or +';
anyErrorsNow = true;
} else if (accountObj['emergencyContactCountryCode'].length > 4) {
Expand Down

0 comments on commit 3e63146

Please sign in to comment.