pendant req
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user