feat: Ajout de projet

This commit is contained in:
2026-09-23 12:56:51 +02:00
parent ad85a96c33
commit d3040c0268
3 changed files with 43 additions and 0 deletions
+23
View File
@@ -39,6 +39,13 @@ export class Home {
});
showGroupForm: boolean = false;
newProjectForm = new FormGroup({
name: new FormControl('', Validators.required),
});
showProjectForm: boolean = false;
//#endregion
public ngOnInit(): void {
@@ -92,4 +99,20 @@ export class Home {
});
}
public toggleProjectForm(): void {
this.showProjectForm = !this.showProjectForm;
}
/**
* submitProject
*/
public submitProject() {
let response: Observable<Project> = this.projectService.addProject(this.newProjectForm.controls.name.value!);
response.subscribe(response => {
this.projects.update(values => {
return [...values, response];
});
});
}
}