swipe-delete button

This commit is contained in:
tiago.kayaya
2021-04-20 00:28:16 +01:00
parent 2499fe7794
commit 77075b3473
7 changed files with 70 additions and 13 deletions
@@ -57,6 +57,28 @@ export class GroupContactsPage implements OnInit {
console.log(this.isGroupCreated);
}
deleteMember(data:any){
let body = {
"roomId": this.room._id,
"userId": data._id,
}
console.log(this.room);
console.log(body);
if(this.room.t == "p"){
this.chatService.removeGroupMember(body).subscribe(res=>{
console.log(res);
this.loadUsers();
});
}
else if(this.room.t == "c"){
this.chatService.removeChannelMember(body).subscribe(res=>{
console.log(res);
this.loadUsers();
});
}
}
loadUsers(){
this.options = {
headers: this.headers,