improvements

This commit is contained in:
tiago.kayaya
2021-01-13 10:02:30 +01:00
parent 6596941cdd
commit 586651e95e
18 changed files with 591 additions and 205 deletions
@@ -4,7 +4,7 @@
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</ion-col>
<ion-col>
<button full class="btn-delete" shape="round" >Apagar conversa</button>
<button (click)="closeChatRoom()" full class="btn-delete" shape="round" >Apagar conversa</button>
</ion-col>
</ion-row>
</ion-content>
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { PopoverController } from '@ionic/angular';
import { NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@Component({
selector: 'app-messages-options',
@@ -8,9 +9,16 @@ import { PopoverController } from '@ionic/angular';
})
export class MessagesOptionsPage implements OnInit {
roomId:string;
constructor(
private popoverController: PopoverController
) { }
private popoverController: PopoverController,
private chatService: ChatService,
private navParams: NavParams,
)
{
this.roomId = this.navParams.get('roomId');
}
ngOnInit() {
}
@@ -19,4 +27,12 @@ export class MessagesOptionsPage implements OnInit {
this.popoverController.dismiss();
}
closeChatRoom(){
let body = { "roomId": this.roomId }
this.chatService.removeChatRoom(body).subscribe(res=>{
console.log(res);
});
this.close();
}
}