pendant req

This commit is contained in:
batche
2022-12-11 16:46:13 +01:00
parent a9460fb41c
commit 34bdcad3a2
2 changed files with 4 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ export class FriendshipController {
@UseGuards(TwoFactorGuard) @UseGuards(TwoFactorGuard)
findAllPendantFriendshipRequested(@Req() req) { findAllPendantFriendshipRequested(@Req() req) {
const user = req.user; const user = req.user;
return this.friendshipService.findAllPendantRequestsForFriendship(user.id); return this.friendshipService.findAllPendantRequestsForFriendship(user.username);
} }
// GET http://transcendance:8080/api/v2/network/received // GET http://transcendance:8080/api/v2/network/received
@@ -107,6 +107,6 @@ export class FriendshipController {
@UseGuards(TwoFactorGuard) @UseGuards(TwoFactorGuard)
findAllPendantFriendshipReceived(@Req() req) { findAllPendantFriendshipReceived(@Req() req) {
const user = req.user; const user = req.user;
return this.friendshipService.findAllReceivedRequestsForFriendship(user.id); return this.friendshipService.findAllReceivedRequestsForFriendship(user.username);
} }
} }

View File

@@ -64,8 +64,10 @@ export class FriendshipService {
.getMany(); .getMany();
let partialFriendship : Partial<Friendship>[] = []; let partialFriendship : Partial<Friendship>[] = [];
for (const friend of friendship) { for (const friend of friendship) {
console.log("FRIENDSHIP : " + friend);
partialFriendship.push({id: friend.id, senderUsername: friend.senderUsername, receiverUsername: friend.receiverUsername, status: friend.status}); partialFriendship.push({id: friend.id, senderUsername: friend.senderUsername, receiverUsername: friend.receiverUsername, status: friend.status});
} }
console.log("Pendant requests : " + partialFriendship);
return partialFriendship; return partialFriendship;
} }