can create and join rooms, but messages are all mixed up

This commit is contained in:
hugogogo
2023-01-09 08:43:55 +01:00
parent ebbd5ff530
commit 258e7596fe
5 changed files with 148 additions and 152 deletions

View File

@@ -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];