can create and join rooms, but messages are all mixed up
This commit is contained in:
@@ -30,7 +30,7 @@ export class ChatService {
|
||||
console.log("-- in getMyRooms service");
|
||||
const rooms = await this.chatroomRepository
|
||||
.createQueryBuilder('chatroom')
|
||||
.where(':user_name ANY(chatroom.users)', { user_name: user.username })
|
||||
.where('chatroom.users LIKE :user_name', { user_name: `%${user.username}%` })
|
||||
.getMany();
|
||||
|
||||
return rooms;
|
||||
@@ -53,7 +53,7 @@ export class ChatService {
|
||||
const rooms = await this.chatroomRepository
|
||||
.createQueryBuilder('chatroom')
|
||||
.where('chatroom.type != :type', { type: 'private' })
|
||||
.andWhere(':user_name NOT IN (chatroom.users)', { user_name: user.username })
|
||||
.andWhere('chatroom.users NOT LIKE :user_name', { user_name: `%${user.username}%` })
|
||||
.getMany();
|
||||
//const users = await this.findAllUsers();
|
||||
//let allRooms = [...rooms, ...users];
|
||||
|
||||
Reference in New Issue
Block a user