mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Add returned properties to the CreateRoom mutation, add emit to change the roomID.
This commit is contained in:
parent
a82d245f63
commit
13da3ba3f4
@ -417,6 +417,8 @@ export default {
|
||||
})
|
||||
.then(({ data: { CreateRoom } }) => {
|
||||
this.fetchRooms({ room: CreateRoom, options: { refetch: true } })
|
||||
this.roomId = CreateRoom.id
|
||||
this.$emit('show-chat', CreateRoom.id)
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast.error(error.message)
|
||||
|
||||
@ -5,6 +5,18 @@ export const createRoom = () => gql`
|
||||
CreateRoom(userId: $userId) {
|
||||
id
|
||||
roomId
|
||||
roomName
|
||||
lastMessageAt
|
||||
unreadCount
|
||||
#avatar
|
||||
users {
|
||||
_id
|
||||
id
|
||||
name
|
||||
avatar {
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
:roomId="getShowChat.showChat ? getShowChat.roomID : null"
|
||||
ref="chat"
|
||||
@toggle-user-search="showUserSearch = !showUserSearch"
|
||||
:show-room="showRoom"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -47,6 +48,9 @@ export default {
|
||||
addChatRoom(userID) {
|
||||
this.$refs.chat.newRoom(userID)
|
||||
},
|
||||
showRoom(roomId) {
|
||||
this.showChat({ showChat: true, roomID: roomId })
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user