aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-05 13:54:35 +0200
committerChocobozzz <me@florianbigard.com>2021-08-05 13:54:35 +0200
commit27db78400c558e19bfac0da885fe0b7d0a3e6a0c (patch)
treee50e031f4b0989e438f3c1610c0a16086dd9455f /client/src/app
parent352819ef921e45381b3fbb17072926103b320e73 (diff)
downloadPeerTube-27db78400c558e19bfac0da885fe0b7d0a3e6a0c.tar.gz
PeerTube-27db78400c558e19bfac0da885fe0b7d0a3e6a0c.tar.zst
PeerTube-27db78400c558e19bfac0da885fe0b7d0a3e6a0c.zip
Fix backend channel name validator consistency
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/shared/form-validators/video-channel-validators.ts10
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 @@
1import { Validators } from '@angular/forms' 1import { Validators } from '@angular/forms'
2import { BuildFormValidator } from './form-validator.model' 2import { BuildFormValidator } from './form-validator.model'
3import { USER_USERNAME_VALIDATOR } from './user-validators'
3 4
4export const VIDEO_CHANNEL_NAME_VALIDATOR: BuildFormValidator = { 5export 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.`,