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);
|
private toastCtrl = inject(ToastController);
|
||||||
|
|
||||||
friends = signal<GetFriendDto[]>([]);
|
friends = signal<GetFriendDto[]>([]);
|
||||||
newGroup = output<CreateGroupDto>();
|
newGroup = output<GetGroupDto>();
|
||||||
|
|
||||||
groupForm: FormGroup = new FormGroup({
|
groupForm: FormGroup = new FormGroup({
|
||||||
label: new FormControl<string>(null, [Validators.required]),
|
label: new FormControl<string>(null, [Validators.required]),
|
||||||
@@ -92,8 +92,8 @@ export class GroupFormComponent implements OnInit {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await firstValueFrom(this.groupsServices.createGroupEndpoint(createGroupDto));
|
const group = await firstValueFrom(this.groupsServices.createGroupEndpoint(createGroupDto));
|
||||||
this.newGroup.emit(createGroupDto);
|
this.newGroup.emit(group);
|
||||||
const toast = await this.toastCtrl.create({
|
const toast = await this.toastCtrl.create({
|
||||||
message: 'Le groupe a été crée',
|
message: 'Le groupe a été crée',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export class HomeComponent implements OnInit {
|
|||||||
this.isModalOpen = isOpen;
|
this.isModalOpen = isOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateGroup(newGroup: CreateGroupDto) {
|
async updateGroup(newGroup: GetGroupDto) {
|
||||||
this.groups.update(x => [...x, newGroup])
|
this.groups.update(x => [...x, newGroup])
|
||||||
await this.setOpen(false, true);
|
await this.setOpen(false, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user