mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +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 } }) => {
|
.then(({ data: { CreateRoom } }) => {
|
||||||
this.fetchRooms({ room: CreateRoom, options: { refetch: true } })
|
this.fetchRooms({ room: CreateRoom, options: { refetch: true } })
|
||||||
|
this.roomId = CreateRoom.id
|
||||||
|
this.$emit('show-chat', CreateRoom.id)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.$toast.error(error.message)
|
this.$toast.error(error.message)
|
||||||
|
|||||||
@ -5,6 +5,18 @@ export const createRoom = () => gql`
|
|||||||
CreateRoom(userId: $userId) {
|
CreateRoom(userId: $userId) {
|
||||||
id
|
id
|
||||||
roomId
|
roomId
|
||||||
|
roomName
|
||||||
|
lastMessageAt
|
||||||
|
unreadCount
|
||||||
|
#avatar
|
||||||
|
users {
|
||||||
|
_id
|
||||||
|
id
|
||||||
|
name
|
||||||
|
avatar {
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
:roomId="getShowChat.showChat ? getShowChat.roomID : null"
|
:roomId="getShowChat.showChat ? getShowChat.roomID : null"
|
||||||
ref="chat"
|
ref="chat"
|
||||||
@toggle-user-search="showUserSearch = !showUserSearch"
|
@toggle-user-search="showUserSearch = !showUserSearch"
|
||||||
|
:show-room="showRoom"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -47,6 +48,9 @@ export default {
|
|||||||
addChatRoom(userID) {
|
addChatRoom(userID) {
|
||||||
this.$refs.chat.newRoom(userID)
|
this.$refs.chat.newRoom(userID)
|
||||||
},
|
},
|
||||||
|
showRoom(roomId) {
|
||||||
|
this.showChat({ showChat: true, roomID: roomId })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user