diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 0300bf6..da54312 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -7,6 +7,7 @@ import { MitarbeiterBearbeitenViewComponent } from "./components/mitarbeiter-bea
import { AuthGuard } from "./service/auth.service";
import { MitarbeiterErstellenComponent } from "./components/mitarbeiter-erstellen/mitarbeiter-erstellen.component";
import { QualifikationsverwaltungComponent } from "./components/qualifikationsverwaltung/qualifikationsverwaltung.component";
+import { QulifikationErstellenComponent } from "./components/qualifikation-erstellen/qualifikation-erstellen.component";
export const routes: Routes = [
{
@@ -18,6 +19,11 @@ export const routes: Routes = [
component: MitarbeiterverwaltungViewComponent,
canActivate: [AuthGuard],
},
+ {
+ path: "qualifikationerstellen",
+ component: QulifikationErstellenComponent,
+ canActivate: [AuthGuard],
+ },
{
path: "mitarbeitererstellen",
component: MitarbeiterErstellenComponent,
diff --git a/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.css b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.html b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.html
new file mode 100644
index 0000000..adfe33c
--- /dev/null
+++ b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.html
@@ -0,0 +1 @@
+
diff --git a/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.spec.ts b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.spec.ts
new file mode 100644
index 0000000..a44fe02
--- /dev/null
+++ b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { QulifikationErstellenComponent } from './qulifikation-erstellen.component';
+
+describe('QulifikationErstellenComponent', () => {
+ let component: QulifikationErstellenComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [QulifikationErstellenComponent]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(QulifikationErstellenComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.ts b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.ts
new file mode 100644
index 0000000..f0f2cf9
--- /dev/null
+++ b/src/app/components/qualifikation-erstellen/qualifikation-erstellen.component.ts
@@ -0,0 +1,29 @@
+import { Component } from '@angular/core';
+import { QualifikationFormComponent } from '../qualifikation-form/qualifikation-form.component';
+import { QualificationGetDTO } from '../../models/skill';
+import { SkillService } from '../../service/skill.service';
+
+@Component({
+ selector: 'app-qulifikation-erstellen',
+ standalone: true,
+ imports: [QualifikationFormComponent],
+ templateUrl: './qualifikation-erstellen.component.html',
+ styleUrl: './qualifikation-erstellen.component.css'
+})
+export class QulifikationErstellenComponent {
+ public skill!: QualificationGetDTO;
+
+ constructor(private skillService: SkillService) { }
+
+ submitted(skill: QualificationGetDTO) {
+ console.log(skill);
+ this.skillService.createSkill(skill);
+ }
+
+ ngOnInit(): void {
+ this.skill = {
+ id: 0,
+ skill: '',
+ };
+ }
+}
diff --git a/src/app/components/qualifikation-form/qualifikation-form.component.ts b/src/app/components/qualifikation-form/qualifikation-form.component.ts
index 21ccf24..aad7492 100644
--- a/src/app/components/qualifikation-form/qualifikation-form.component.ts
+++ b/src/app/components/qualifikation-form/qualifikation-form.component.ts
@@ -115,7 +115,7 @@ export class QualifikationFormComponent {
this.skill.skill = this.skillForm.get("name")?.value;
this.skillChange.emit(this.skill);
- this.router.navigate(["/qualifikationen"]);
+ this.router.navigate(["/qualifikationsverwaltung"]);
}
ngOnChanges(): void {
diff --git a/src/app/components/qualifikaton-bearbeiten-view/qualifikaton-bearbeiten-view.component.ts b/src/app/components/qualifikaton-bearbeiten-view/qualifikaton-bearbeiten-view.component.ts
index 791b8ec..b95a8eb 100644
--- a/src/app/components/qualifikaton-bearbeiten-view/qualifikaton-bearbeiten-view.component.ts
+++ b/src/app/components/qualifikaton-bearbeiten-view/qualifikaton-bearbeiten-view.component.ts
@@ -15,7 +15,7 @@ import { ActivatedRoute } from '@angular/router';
export class QualifikatonBearbeitenViewComponent {
public skill!: QualificationGetDTO;
- constructor(private skillService: SkillService, private route: ActivatedRoute) {}
+ constructor(private skillService: SkillService, private route: ActivatedRoute) { }
submitted(skill: QualificationGetDTO) {
this.skillService.updateSkill(skill);
diff --git a/src/app/service/skill.service.ts b/src/app/service/skill.service.ts
index 9e7f833..d0321a2 100644
--- a/src/app/service/skill.service.ts
+++ b/src/app/service/skill.service.ts
@@ -28,6 +28,10 @@ export class SkillService {
}
}
+ createSkill(skill: QualificationGetDTO) {
+ this.http.post(`${SkillService.BASE_URL}/qualifications`, this.getToPutDto(skill)).subscribe();
+ }
+
constructor(private http: HttpClient, private employeeService: EmployeeService) {
}