fix(qualifikation-form): prevent adding invalid employee ID
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m26s

This commit is contained in:
Jan Gleytenhoover 2025-01-22 12:12:11 +01:00
parent 9be7a52f57
commit 3f61480e2f
Signed by: jank
GPG key ID: 50620ADD22CD330B

View file

@ -55,6 +55,9 @@ export class QualifikationFormComponent {
addEmployee() { addEmployee() {
const employeeId = Number(this.skillForm.get("newEmployee")?.value); const employeeId = Number(this.skillForm.get("newEmployee")?.value);
if (!employeeId) {
return;
}
const employee = this.addableEmployees.find(emp => emp.id === employeeId); const employee = this.addableEmployees.find(emp => emp.id === employeeId);
if (employee) { if (employee) {