mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
backend room hacks
This commit is contained in:
parent
c2c96ee96c
commit
5f2cfdeab4
@ -12,7 +12,11 @@ export default {
|
||||
if (resolved) {
|
||||
resolved.forEach((room) => {
|
||||
if (room.users) {
|
||||
// buggy, you must query the username for this to function correctly
|
||||
room.roomName = room.users.filter((user) => user.id !== context.user.id)[0].name
|
||||
room.avatar =
|
||||
room.users.filter((user) => user.id !== context.user.id)[0].avatar?.url ||
|
||||
'default-avatar'
|
||||
room.users.forEach((user) => {
|
||||
user._id = user.id
|
||||
})
|
||||
|
||||
@ -14,6 +14,7 @@ type Room {
|
||||
|
||||
roomId: String! @cypher(statement: "RETURN this.id")
|
||||
roomName: String! ## @cypher(statement: "MATCH (this)<-[:CHATS_IN]-(user:User) WHERE NOT user.id = $cypherParams.currentUserId RETURN user[0].name")
|
||||
avatar: String! ## @cypher match not own user in users array
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user