Fixed error with GroupId il list of groups
This commit is contained in:
@@ -28,7 +28,7 @@ export class GroupFormComponent implements OnInit {
|
||||
private toastCtrl = inject(ToastController);
|
||||
|
||||
friends = signal<GetFriendDto[]>([]);
|
||||
newGroup = output<CreateGroupDto>();
|
||||
newGroup = output<GetGroupDto>();
|
||||
|
||||
groupForm: FormGroup = new FormGroup({
|
||||
label: new FormControl<string>(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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user