Feature: Add Qualification

This commit is contained in:
Ole Kück 2025-01-21 12:47:26 +01:00
parent 264cd3f209
commit 76541fa2a8
Signed by: SZUT-Ole
GPG key ID: 0A1DF1B37C4A1E4C
2 changed files with 12 additions and 2 deletions

View file

@ -2,9 +2,9 @@
<div class="qualifications__action-row"> <div class="qualifications__action-row">
<mat-form-field> <mat-form-field>
<mat-label>Qualification</mat-label> <mat-label>Qualification</mat-label>
<input matInput> <input matInput #qualificationInput minlength="1" maxlength="25">
</mat-form-field> </mat-form-field>
<button mat-fab class="shadowless"> <button mat-fab class="shadowless" (click)="onAdd(qualificationInput)">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> </button>
</div> </div>

View file

@ -79,6 +79,16 @@ export class QualificationsComponent {
this.qualificationEdits.set(id, true); this.qualificationEdits.set(id, true);
} }
onAdd(qualificationField: HTMLInputElement){
this.qualificationService.createQualification({requestBody: {skill: qualificationField.value}}).subscribe((qualification)=>{
const data = this.qualificationDataSource.data;
data.push(qualification);
this.qualificationDataSource = new MatTableDataSource<Qualification>(data);
this.notifications.publish(`Added ${qualification.skill}`);
qualificationField.value='';
});
}
endEdit(oldQualification: Qualification, save: boolean) { endEdit(oldQualification: Qualification, save: boolean) {
const qualificationFormGroup = this.qualificationSkillFormGroups.get(oldQualification.id); const qualificationFormGroup = this.qualificationSkillFormGroups.get(oldQualification.id);