diff --git a/src/app/components/employee-detail/employee-detail.component.html b/src/app/components/employee-detail/employee-detail.component.html index 0968dfb..db72d82 100644 --- a/src/app/components/employee-detail/employee-detail.component.html +++ b/src/app/components/employee-detail/employee-detail.component.html @@ -1,16 +1,16 @@
- +

{{ employee.firstName }} {{ employee.lastName }}

-

Straße: {{ employee.street }}

-

Postleitzahl: {{ employee.postcode }}

-

Stadt: {{ employee.city }}

-

Telefonnummer: {{ employee.phone }}s

- - +

Street: {{ employee.street }}

+

Postal Code: {{ employee.postcode }}

+

City: {{ employee.city }}

+

Phone number: {{ employee.phone }}s

+ +
diff --git a/src/app/components/mitarbeiter-form/mitarbeiter-form.component.ts b/src/app/components/mitarbeiter-form/mitarbeiter-form.component.ts index 215be8f..f6c69e8 100644 --- a/src/app/components/mitarbeiter-form/mitarbeiter-form.component.ts +++ b/src/app/components/mitarbeiter-form/mitarbeiter-form.component.ts @@ -38,7 +38,7 @@ export class MitarbeiterFormComponent { postcode: new FormControl(this.mitarbeiter.postcode, [Validators.required, Validators.minLength(5), Validators.maxLength(5)]), city: new FormControl(this.mitarbeiter.city, Validators.required), phone: new FormControl(this.mitarbeiter.phone, [Validators.required, Validators.pattern('^[- +()0-9]+$')]), - newSkill: new FormControl(null, Validators.required) // Added + newSkill: new FormControl(null) }); } @@ -82,6 +82,9 @@ export class MitarbeiterFormComponent { addSkill() { const id = Number(this.mitarbeiterForm.get("newSkill")?.value); + if (!id) { + return; + } this.allSkills.subscribe(skills => { const newSkill = skills.filter(skill => skill.id == id)[0]; this.mitarbeiter.skillSet?.push(newSkill); diff --git a/src/app/components/qualifikation-form/qualifikation-form.component.ts b/src/app/components/qualifikation-form/qualifikation-form.component.ts index aad7492..03c1353 100644 --- a/src/app/components/qualifikation-form/qualifikation-form.component.ts +++ b/src/app/components/qualifikation-form/qualifikation-form.component.ts @@ -55,6 +55,9 @@ export class QualifikationFormComponent { addEmployee() { const employeeId = Number(this.skillForm.get("newEmployee")?.value); + if (!employeeId) { + return; + } const employee = this.addableEmployees.find(emp => emp.id === employeeId); if (employee) {