Skip to content

Commit 81f4720

Browse files
committed
Step 4.21: Implement remove chat with the Collection
1 parent 9e52e87 commit 81f4720

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/pages/chats/chats.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,7 @@ export class ChatsPage implements OnInit {
3131
}
3232

3333
removeChat(chat: Chat): void {
34-
this.chats = this.chats.map((chatsArray: Chat[]) => {
35-
const chatIndex = chatsArray.indexOf(chat);
36-
if (chatIndex !== -1) {
37-
chatsArray.splice(chatIndex, 1);
38-
}
39-
40-
return chatsArray;
34+
Chats.remove({_id: chat._id}).subscribe(() => {
4135
});
4236
}
4337
}

0 commit comments

Comments
 (0)