From 27db78400c558e19bfac0da885fe0b7d0a3e6a0c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Aug 2021 13:54:35 +0200 Subject: Fix backend channel name validator consistency --- .../src/app/shared/form-validators/video-channel-validators.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'client/src/app/shared/form-validators') 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 @@ import { Validators } from '@angular/forms' import { BuildFormValidator } from './form-validator.model' +import { USER_USERNAME_VALIDATOR } from './user-validators' export const VIDEO_CHANNEL_NAME_VALIDATOR: BuildFormValidator = { - VALIDATORS: [ - Validators.required, - Validators.minLength(1), - Validators.maxLength(50), - Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) - ], + // Use the same constraints than user usernmae + VALIDATORS: USER_USERNAME_VALIDATOR.VALIDATORS, + MESSAGES: { 'required': $localize`Name is required.`, 'minlength': $localize`Name must be at least 1 character long.`, -- cgit v1.2.3