diff --git a/src/app/components/businessunit/businessunit-add/businessunit-add.component.ts b/src/app/components/businessunit/businessunit-add/businessunit-add.component.ts index 4f37c3d..69452ae 100644 --- a/src/app/components/businessunit/businessunit-add/businessunit-add.component.ts +++ b/src/app/components/businessunit/businessunit-add/businessunit-add.component.ts @@ -12,7 +12,6 @@ import {ToastrService} from "ngx-toastr"; }) export class BusinessunitAddComponent implements OnInit { - businessunits: Businessunit[] = []; businessunit = {} as Businessunit; registerForm!: FormGroup; @@ -31,21 +30,14 @@ export class BusinessunitAddComponent implements OnInit { } ngOnInit(): void { - this.getBusinessunits(); this.registerForm = this.formBuilder.group({ name: ['', Validators.required], }); } - getBusinessunits(): void { - this.businessunitService.getBusinessunits() - .subscribe(businessunits => this.businessunits = businessunits); - } - add(businessunit: Businessunit): void { this.businessunitService.addBusinessunit(businessunit) - .subscribe(businessunit => { - this.businessunits.push(businessunit); + .subscribe(() => { this.showSuccess(); }, () => { diff --git a/src/app/components/businessunit/businessunit.component.html b/src/app/components/businessunit/businessunit.component.html index 2b003cc..bf1f2bf 100644 --- a/src/app/components/businessunit/businessunit.component.html +++ b/src/app/components/businessunit/businessunit.component.html @@ -2,6 +2,11 @@

Business Units

+
+

Pour ajouter une nouvelle business unit, cliquez ici :

+ +
+