Skip to content

Commit b2dba56

Browse files
authored
Merge pull request #194 from h0wter/fix/th-183-fix-the-phone-field
th-183: Update validation rule and error message
2 parents a0b3818 + b89cf12 commit b2dba56

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

frontend/src/pages/auth/components/sign-up-form/sign-up-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const SignUpForm: React.FC<Properties> = ({ onSubmit, mode }: Properties) => {
4747
)}
4848

4949
<p className={getValidClassNames('textSm', styles.text)}>
50-
Already have an account? Go to{' '}
50+
Already have an account? Go to
5151
<Link to={AppRoute.SIGN_IN} className={styles.link}>
5252
Log in
5353
</Link>

shared/src/packages/users/libs/validation-schemas/enums/user-validation-message.enum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const UserValidationMessage = {
33
EMAIL_NOT_VALID: 'This email does not seem valid',
44
PASSWORD_NOT_VALID: 'Must be 6+ characters, at least 1 letter and 1 number',
55
NAME_NOT_VALID: 'Must be 1 - 40 characters, start with a letter, no digits',
6-
PHONE_NOT_VALID: 'Must be 8 - 17 digits, start with +',
6+
PHONE_NOT_VALID: 'Must be 7-18 digits, start with +',
77
TAX_NUMBER_NOT_VALID: 'Must be 8 or more characters',
88
COMPANY_NAME_NOT_VALID: 'Must be 8 or more characters',
99
DRIVER_LICENSE_NUMBER_NOT_VALID:

shared/src/packages/users/libs/validation-schemas/enums/user-validation-rule.enum.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const UserValidationRule = {
22
PASSWORD: /^(?=.*[A-Za-z])(?=.*\d)[\dA-Za-z]{6,20}$/,
3-
NAME: /^[A-Za-z][\s'A-Za-z-]{0,39}$/,
4-
PHONE: /^\+\d{8,19}$/,
3+
NAME: /^['A-Za-z-]{1,40}$/,
4+
PHONE: /^\+\d{7,18}$/,
55
TAX_NUMBER: /^[\d\s./A-Z-]{8,19}$/,
66
COMPANY_NAME: /^[\s\w!#&'*+,.;?@~-]{1,40}$/,
77
EMAIL_MIN_LENGTH: 5,

0 commit comments

Comments
 (0)