From 0221f8c9b174c1c95b7348215f0d652bb1899c6b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 25 Feb 2021 10:01:33 +0100 Subject: Trim video name also on server --- client/src/app/shared/form-validators/video-validators.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'client/src/app/shared/form-validators') diff --git a/client/src/app/shared/form-validators/video-validators.ts b/client/src/app/shared/form-validators/video-validators.ts index 0000f18ba..1382a7747 100644 --- a/client/src/app/shared/form-validators/video-validators.ts +++ b/client/src/app/shared/form-validators/video-validators.ts @@ -3,15 +3,14 @@ import { BuildFormValidator } from './form-validator.model' export const trimValidator: ValidatorFn = (control: FormControl) => { if (control.value.startsWith(' ') || control.value.endsWith(' ')) { - return { - 'spaces': true - } + return { spaces: true } } - return null; -}; + + return null +} export const VIDEO_NAME_VALIDATOR: BuildFormValidator = { - VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120), trimValidator ], + VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], MESSAGES: { 'required': $localize`Video name is required.`, 'minlength': $localize`Video name must be at least 3 characters long.`, -- cgit v1.2.3