wip directs
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user