diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validator.service.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/form-validator.service.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-forms/form-validator.service.ts b/client/src/app/shared/shared-forms/form-validator.service.ts index 41c8b76bd..c0664de5f 100644 --- a/client/src/app/shared/shared-forms/form-validator.service.ts +++ b/client/src/app/shared/shared-forms/form-validator.service.ts | |||
@@ -28,11 +28,11 @@ export class FormValidatorService { | |||
28 | continue | 28 | continue |
29 | } | 29 | } |
30 | 30 | ||
31 | if (field && field.MESSAGES) validationMessages[name] = field.MESSAGES as { [ name: string ]: string } | 31 | if (field?.MESSAGES) validationMessages[name] = field.MESSAGES as { [ name: string ]: string } |
32 | 32 | ||
33 | const defaultValue = defaultValues[name] || '' | 33 | const defaultValue = defaultValues[name] || '' |
34 | 34 | ||
35 | if (field && field.VALIDATORS) group[name] = [ defaultValue, field.VALIDATORS ] | 35 | if (field?.VALIDATORS) group[name] = [ defaultValue, field.VALIDATORS ] |
36 | else group[name] = [ defaultValue ] | 36 | else group[name] = [ defaultValue ] |
37 | } | 37 | } |
38 | 38 | ||
@@ -62,11 +62,11 @@ export class FormValidatorService { | |||
62 | continue | 62 | continue |
63 | } | 63 | } |
64 | 64 | ||
65 | if (field && field.MESSAGES) validationMessages[name] = field.MESSAGES as { [ name: string ]: string } | 65 | if (field?.MESSAGES) validationMessages[name] = field.MESSAGES as { [ name: string ]: string } |
66 | 66 | ||
67 | const defaultValue = defaultValues[name] || '' | 67 | const defaultValue = defaultValues[name] || '' |
68 | 68 | ||
69 | if (field && field.VALIDATORS) form.addControl(name, new FormControl(defaultValue, field.VALIDATORS as ValidatorFn[])) | 69 | if (field?.VALIDATORS) form.addControl(name, new FormControl(defaultValue, field.VALIDATORS as ValidatorFn[])) |
70 | else form.addControl(name, new FormControl(defaultValue)) | 70 | else form.addControl(name, new FormControl(defaultValue)) |
71 | } | 71 | } |
72 | } | 72 | } |