wip directs

This commit is contained in:
simplonco
2023-01-11 10:07:38 +01:00
parent 9aad7019ab
commit e97de4f137
6 changed files with 26 additions and 8 deletions

View File

@@ -42,8 +42,8 @@ export class ChatController {
{
console.log("- in getAllRooms controller");
const rooms = await this.chatService.getAllNotMyRooms(req.user.username);
const directs = await this.chatService.getAllUsersNotMyRooms(req.user.username);
return res.status(HttpStatus.OK).json({ rooms: rooms, directs: directs });
const users = await this.chatService.getAllUsersNotMyRooms(req.user.username);
return res.status(HttpStatus.OK).json({ rooms: rooms, users: users });
}
@UseGuards(AuthenticateGuard)

View File

@@ -222,8 +222,7 @@ export class ChatService {
const directs = await this.getMyDirects(username);
let usernames = directs.map(room => room.users[0]);
if (usernames.length === 0)
usernames = [""];
usernames.push(username);
console.log("usernames:", usernames);
const users = await this.userRepository