diff --git a/src/app/components/group-form/group-form.component.ts b/src/app/components/group-form/group-form.component.ts index c40e5dd..67d6609 100644 --- a/src/app/components/group-form/group-form.component.ts +++ b/src/app/components/group-form/group-form.component.ts @@ -28,7 +28,7 @@ export class GroupFormComponent implements OnInit { private toastCtrl = inject(ToastController); friends = signal([]); - newGroup = output(); + newGroup = output(); groupForm: FormGroup = new FormGroup({ label: new FormControl(null, [Validators.required]), @@ -92,8 +92,8 @@ export class GroupFormComponent implements OnInit { }; try { - await firstValueFrom(this.groupsServices.createGroupEndpoint(createGroupDto)); - this.newGroup.emit(createGroupDto); + const group = await firstValueFrom(this.groupsServices.createGroupEndpoint(createGroupDto)); + this.newGroup.emit(group); const toast = await this.toastCtrl.create({ message: 'Le groupe a été crée', duration: 2000, diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index a6f0e0e..1fbbbd7 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -140,7 +140,7 @@ export class HomeComponent implements OnInit { this.isModalOpen = isOpen; } - async updateGroup(newGroup: CreateGroupDto) { + async updateGroup(newGroup: GetGroupDto) { this.groups.update(x => [...x, newGroup]) await this.setOpen(false, true); }