aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/forms/form-validators/user.ts')
-rw-r--r--client/src/app/shared/forms/form-validators/user.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/user.ts b/client/src/app/shared/forms/form-validators/user.ts
index 5b11ff265..0ad0e2a4b 100644
--- a/client/src/app/shared/forms/form-validators/user.ts
+++ b/client/src/app/shared/forms/form-validators/user.ts
@@ -1,5 +1,7 @@
1import { Validators } from '@angular/forms'; 1import { Validators } from '@angular/forms';
2 2
3import { validateEmail } from './email.validator';
4
3export const USER_USERNAME = { 5export const USER_USERNAME = {
4 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(20) ], 6 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(20) ],
5 MESSAGES: { 7 MESSAGES: {
@@ -8,6 +10,13 @@ export const USER_USERNAME = {
8 'maxlength': 'Username cannot be more than 20 characters long.' 10 'maxlength': 'Username cannot be more than 20 characters long.'
9 } 11 }
10}; 12};
13export const USER_EMAIL = {
14 VALIDATORS: [ Validators.required, validateEmail ],
15 MESSAGES: {
16 'required': 'Email is required.',
17 'email': 'Email must be valid.',
18 }
19};
11export const USER_PASSWORD = { 20export const USER_PASSWORD = {
12 VALIDATORS: [ Validators.required, Validators.minLength(6) ], 21 VALIDATORS: [ Validators.required, Validators.minLength(6) ],
13 MESSAGES: { 22 MESSAGES: {