correction d'un appel non protégé

This commit is contained in:
cherif
2023-01-17 10:16:47 +01:00
parent 6e139bdacc
commit 86b8ab74a2

View File

@@ -372,11 +372,14 @@ export class ChatService {
async getListBlockUser(username: string): Promise<string[]> async getListBlockUser(username: string): Promise<string[]>
{ {
printCaller("-- in "); printCaller("-- in ");
let users: string[] = [];
let user = await this.getUserByName(username); let user = await this.getUserByName(username);
let friends_users = await this.friendshipService.findAllBlockedFriends(user.id); console.log("USERNAME CHAT SRVICE " + username);
let users = friends_users.map(user => user.receiverUsername); let friends_users;
if (user)
friends_users = await this.friendshipService.findAllBlockedFriends(user.id);
if (friends_users)
users = friends_users.map(user => user.receiverUsername);
printCaller("-- out "); printCaller("-- out ");
return users; return users;
} }