delete room

This commit is contained in:
Peter Maquiran
2024-06-12 11:56:21 +01:00
parent 295fe96da6
commit 4f348e0bf7
2 changed files with 31 additions and 3 deletions
@@ -110,11 +110,26 @@ export class ChatPopoverPage implements OnInit {
}
//Delete
deleteGroup() {
let body = { "roomId":this.roomId }
async deleteGroup() {
this.showLoader = true
const result = await this.RoomRepositoryService.deleteRoomById(this.roomId)
this.close('delete');
if(result.isOk()) {
this.close('delete');
// this.openGroupMessage.emit(this.roomId);
} else if (result.error instanceof HttpResponse) {
// this.httpErrorHandle.httpStatusHandle(result.error)
} else if (result.error instanceof ZodError) {
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
console.log(result.error.errors)
} else {
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
console.log(result.error)
}
this.showLoader = false
}
async openChangeGroupName(){