feat(qualifikation): add skill management features and fixes
This commit is contained in:
parent
8a4a617c33
commit
3d2f049312
7 changed files with 77 additions and 13 deletions
|
@ -54,13 +54,15 @@ export class EmployeeService {
|
|||
return this.http.get<EmployeeResponseDTO>(`${SkillService.BASE_URL}/employees/${id}`);
|
||||
}
|
||||
|
||||
removeSkillFromEmployee(skillId: number, employee: EmployeeResponseDTO) {
|
||||
let employeePut = this.responseDtoToPutDto(employee);
|
||||
if (employeePut.skillSet.indexOf(skillId) != 1) {
|
||||
employeePut.skillSet = employeePut.skillSet.filter(skill => skill != skillId);
|
||||
}
|
||||
removeSkillFromEmployee(skillId: number, employeeId: number) {
|
||||
this.getEmployeeById(employeeId).subscribe(employee => {
|
||||
let employeePut = this.responseDtoToPutDto(employee);
|
||||
if (employeePut.skillSet.indexOf(skillId) != 1) {
|
||||
employeePut.skillSet = employeePut.skillSet.filter(skill => skill != skillId);
|
||||
}
|
||||
|
||||
this.http.put(`${SkillService.BASE_URL}/employees/${employee.id}`, employeePut).subscribe();
|
||||
this.http.put(`${SkillService.BASE_URL}/employees/${employee.id}`, employeePut).subscribe();
|
||||
});
|
||||
}
|
||||
|
||||
addSkillToEmployee(skillId: number, employee: EmployeeResponseDTO) {
|
||||
|
|
Reference in a new issue