Fix selecting nothing #81

Merged
jank merged 2 commits from fix/fix-selecting-nothing-as-skill into main 2025-01-22 11:17:44 +00:00
Showing only changes of commit 2e9b48be7c - Show all commits

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

Jan K9f 2025-01-22 12:12:11 +01:00 committed by Jan Gleytenhoover

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) {