mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
roomName property
This commit is contained in:
parent
cd23b88dd6
commit
c68339fedf
@ -21,6 +21,7 @@ export const roomQuery = () => {
|
||||
Room {
|
||||
id
|
||||
roomId
|
||||
roomName
|
||||
users {
|
||||
_id
|
||||
id
|
||||
|
||||
@ -141,6 +141,7 @@ describe('Room', () => {
|
||||
{
|
||||
id: expect.any(String),
|
||||
roomId: result.data.Room[0].id,
|
||||
roomName: 'Other Chatting User',
|
||||
users: expect.arrayContaining([
|
||||
{
|
||||
_id: 'chatting-user',
|
||||
@ -180,6 +181,7 @@ describe('Room', () => {
|
||||
{
|
||||
id: expect.any(String),
|
||||
roomId: result.data.Room[0].id,
|
||||
roomName: 'Chatting User',
|
||||
users: expect.arrayContaining([
|
||||
{
|
||||
_id: 'chatting-user',
|
||||
|
||||
@ -13,6 +13,7 @@ export default {
|
||||
if (resolved) {
|
||||
resolved.forEach((room) => {
|
||||
if (room.users) {
|
||||
room.roomName = room.users.filter((user) => user.id !== context.user.id)[0].name
|
||||
room.users.forEach((user) => {
|
||||
user._id = user.id
|
||||
})
|
||||
|
||||
@ -13,6 +13,7 @@ type Room {
|
||||
users: [User]! @relation(name: "CHATS_IN", direction: "IN")
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user