aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts')
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts26
1 files changed, 0 insertions, 26 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts
deleted file mode 100644
index 8c809a0d5..000000000
--- a/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts
+++ /dev/null
@@ -1,26 +0,0 @@
1import { Injectable } from '@angular/core'
2import { AbstractControl, ValidationErrors, Validators } from '@angular/forms'
3import { BuildFormValidator } from './form-validator.service'
4
5@Injectable()
6export class VideoChangeOwnershipValidatorsService {
7 readonly USERNAME: BuildFormValidator
8
9 constructor () {
10 this.USERNAME = {
11 VALIDATORS: [ Validators.required, this.localAccountValidator ],
12 MESSAGES: {
13 'required': $localize`The username is required.`,
14 'localAccountOnly': $localize`You can only transfer ownership to a local account`
15 }
16 }
17 }
18
19 localAccountValidator (control: AbstractControl): ValidationErrors {
20 if (control.value.includes('@')) {
21 return { 'localAccountOnly': true }
22 }
23
24 return null
25 }
26}