feat: add error handling for skill form validation

This commit is contained in:
Jan K9f 2025-01-16 10:46:27 +01:00
parent 6119621040
commit 703d644799
Signed by: jank
GPG key ID: 50620ADD22CD330B
5 changed files with 41 additions and 3 deletions

View file

@ -104,7 +104,7 @@ export class MitarbeiterFormComponent {
Object.keys(this.mitarbeiterForm.controls).forEach(field => {
const control = this.mitarbeiterForm.get(field);
if (control && control.errors && control.touched) {
if (control && control.errors) {
this.errorMessages[field] = Object.keys(control.errors)
.map(errorKey => this.validationErrorMessages[errorKey] || `Unknown error: ${errorKey}`)
.join(' ');