fix(mitarbeiter-form): prevent adding skill with invalid id
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m46s
All checks were successful
Playwright Tests / test (pull_request) Successful in 2m46s
This commit is contained in:
parent
ebd4508743
commit
9be7a52f57
1 changed files with 3 additions and 0 deletions
|
@ -84,6 +84,9 @@ export class MitarbeiterFormComponent {
|
||||||
|
|
||||||
addSkill() {
|
addSkill() {
|
||||||
const id = Number(this.mitarbeiterForm.get("newSkill")?.value);
|
const id = Number(this.mitarbeiterForm.get("newSkill")?.value);
|
||||||
|
if (!id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.allSkills.subscribe(skills => {
|
this.allSkills.subscribe(skills => {
|
||||||
const newSkill = skills.filter(skill => skill.id == id)[0];
|
const newSkill = skills.filter(skill => skill.id == id)[0];
|
||||||
this.mitarbeiter.skillSet?.push(newSkill);
|
this.mitarbeiter.skillSet?.push(newSkill);
|
||||||
|
|
Loading…
Add table
Reference in a new issue