diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index bbdf1bfbe..2c7a10937 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -290,6 +290,25 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
290 | this.router.navigate([], { fragment: this.activeNav }) | 290 | this.router.navigate([], { fragment: this.activeNav }) |
291 | } | 291 | } |
292 | 292 | ||
293 | grabAllErrors (errorObjectArg?: any) { | ||
294 | const errorObject = errorObjectArg || this.formErrors | ||
295 | |||
296 | let acc: string[] = [] | ||
297 | |||
298 | for (const key of Object.keys(errorObject)) { | ||
299 | const value = errorObject[key] | ||
300 | if (!value) continue | ||
301 | |||
302 | if (typeof value === 'string') { | ||
303 | acc.push(value) | ||
304 | } else { | ||
305 | acc = acc.concat(this.grabAllErrors(value)) | ||
306 | } | ||
307 | } | ||
308 | |||
309 | return acc | ||
310 | } | ||
311 | |||
293 | private updateForm () { | 312 | private updateForm () { |
294 | this.form.patchValue(this.customConfig) | 313 | this.form.patchValue(this.customConfig) |
295 | } | 314 | } |