Skip to content

Commit bae418d

Browse files
committed
push new message from backend response
1 parent b947f26 commit bae418d

File tree

1 file changed

+2
-2
lines changed
  • frontend/src/components/app/matches

1 file changed

+2
-2
lines changed

frontend/src/components/app/matches/Chat.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ export default {
9090
if (!this.message.length) {
9191
return;
9292
}
93-
await this.$http.post('/messages/send', {
93+
const response = await this.$http.post('/messages/send', {
9494
to_uid: this.user.id.toString(),
9595
content: this.message,
9696
});
97-
this.messages.push({ to_id: this.chatWithUserId, content: this.message });
97+
this.messages.push(response.data.new_message);
9898
this.message = '';
9999
this.$emit('new-message');
100100
this.scrollChatToBottom();

0 commit comments

Comments
 (0)