]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/forms/form-validators/form-validator.service.ts
Add blacklist reason field
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / form-validator.service.ts
index 5c3d3e4bddb8ccd783b0e2426dd0914fce9a66d9..19a8bef25c6f008f4c030e90144ebdab44adc8be 100644 (file)
@@ -1,13 +1,13 @@
 import { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms'
 import { Injectable } from '@angular/core'
 import { FormReactiveErrors, FormReactiveValidationMessages } from '@app/shared/forms/form-reactive'
-import { I18n } from '@ngx-translate/i18n-polyfill'
 
+export type BuildFormValidator = {
+  VALIDATORS: ValidatorFn[],
+  MESSAGES: { [ name: string ]: string }
+}
 export type BuildFormArgument = {
-  [ id: string ]: {
-    VALIDATORS: ValidatorFn[],
-    MESSAGES: { [ name: string ]: string }
-  }
+  [ id: string ]: BuildFormValidator
 }
 export type BuildFormDefaultValues = {
   [ name: string ]: string | string[]
@@ -17,8 +17,7 @@ export type BuildFormDefaultValues = {
 export class FormValidatorService {
 
   constructor (
-    private formBuilder: FormBuilder,
-    private i18n: I18n
+    private formBuilder: FormBuilder
   ) {}
 
   buildForm (obj: BuildFormArgument, defaultValues: BuildFormDefaultValues = {}) {