Fixed error with visibility of all groups after change
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Component, computed, inject, input, OnInit, signal} from '@angular/core';
|
||||
import {Component, computed, inject, input, OnInit, output, signal} from '@angular/core';
|
||||
import {GetGroupDetailsDto, GroupsService} from "../../services/api";
|
||||
import {addIcons} from "ionicons";
|
||||
import {peopleOutline, banOutline, arrowUpCircleOutline} from "ionicons/icons";
|
||||
@@ -33,6 +33,8 @@ export class GroupInfoComponent implements OnInit {
|
||||
|
||||
date = computed<string>(() => moment(this.group().creationDate).format('DD/MM/YYYY'));
|
||||
|
||||
idGroup = output<number>();
|
||||
|
||||
options = [1, 2, 3];
|
||||
|
||||
ngOnInit() {
|
||||
@@ -76,8 +78,11 @@ export class GroupInfoComponent implements OnInit {
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
const oldGroup = this.group().id;
|
||||
|
||||
try {
|
||||
await firstValueFrom(this.groupsService.leaveGroupEndpoint(this.group().id));
|
||||
await firstValueFrom(this.groupsService.leaveGroupEndpoint(oldGroup));
|
||||
this.idGroup.emit(oldGroup);
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: 'Vous avez quitter ce groupe',
|
||||
duration: 2000,
|
||||
@@ -105,8 +110,11 @@ export class GroupInfoComponent implements OnInit {
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
const oldGroup = this.group().id;
|
||||
|
||||
try {
|
||||
await firstValueFrom(this.groupsService.deleteGroupEndpoint(this.group().id));
|
||||
await firstValueFrom(this.groupsService.deleteGroupEndpoint(oldGroup));
|
||||
this.idGroup.emit(oldGroup);
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: 'Groupe supprimé',
|
||||
duration: 2000,
|
||||
|
||||
Reference in New Issue
Block a user