diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/shared/form-validators/video-channel-validators.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/shared/form-validators/video-channel-validators.ts b/client/src/app/shared/form-validators/video-channel-validators.ts index 0daab22ce..ba502ed01 100644 --- a/client/src/app/shared/form-validators/video-channel-validators.ts +++ b/client/src/app/shared/form-validators/video-channel-validators.ts | |||
@@ -1,13 +1,11 @@ | |||
1 | import { Validators } from '@angular/forms' | 1 | import { Validators } from '@angular/forms' |
2 | import { BuildFormValidator } from './form-validator.model' | 2 | import { BuildFormValidator } from './form-validator.model' |
3 | import { USER_USERNAME_VALIDATOR } from './user-validators' | ||
3 | 4 | ||
4 | export const VIDEO_CHANNEL_NAME_VALIDATOR: BuildFormValidator = { | 5 | export const VIDEO_CHANNEL_NAME_VALIDATOR: BuildFormValidator = { |
5 | VALIDATORS: [ | 6 | // Use the same constraints than user usernmae |
6 | Validators.required, | 7 | VALIDATORS: USER_USERNAME_VALIDATOR.VALIDATORS, |
7 | Validators.minLength(1), | 8 | |
8 | Validators.maxLength(50), | ||
9 | Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) | ||
10 | ], | ||
11 | MESSAGES: { | 9 | MESSAGES: { |
12 | 'required': $localize`Name is required.`, | 10 | 'required': $localize`Name is required.`, |
13 | 'minlength': $localize`Name must be at least 1 character long.`, | 11 | 'minlength': $localize`Name must be at least 1 character long.`, |