diff --git a/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts b/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts index 48e5150f..297be6f8 100644 --- a/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts +++ b/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts @@ -98,7 +98,7 @@ export class FriendshipController { @UseGuards(TwoFactorGuard) findAllPendantFriendshipRequested(@Req() req) { const user = req.user; - return this.friendshipService.findAllPendantRequestsForFriendship(user.id); + return this.friendshipService.findAllPendantRequestsForFriendship(user.username); } // GET http://transcendance:8080/api/v2/network/received @@ -107,6 +107,6 @@ export class FriendshipController { @UseGuards(TwoFactorGuard) findAllPendantFriendshipReceived(@Req() req) { const user = req.user; - return this.friendshipService.findAllReceivedRequestsForFriendship(user.id); + return this.friendshipService.findAllReceivedRequestsForFriendship(user.username); } } diff --git a/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts b/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts index 45f14568..cee750cd 100644 --- a/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts +++ b/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts @@ -64,8 +64,10 @@ export class FriendshipService { .getMany(); let partialFriendship : Partial[] = []; for (const friend of friendship) { + console.log("FRIENDSHIP : " + friend); partialFriendship.push({id: friend.id, senderUsername: friend.senderUsername, receiverUsername: friend.receiverUsername, status: friend.status}); } + console.log("Pendant requests : " + partialFriendship); return partialFriendship; }