changement mineur fonction pour chercher ami via username

This commit is contained in:
batche
2022-12-13 17:47:29 +01:00
parent aa171bd844
commit bd4938b64b

View File

@@ -22,18 +22,20 @@ export class FriendshipController {
// GET http://transcendance:8080/api/v2/network/myfriends/relationshipId
@Get('myfriend/:relationshipId')
@UseGuards(AuthenticateGuard)
@UseGuards(TwoFactorGuard)
findOneFriend(@Param('relationshipId') relationshipId: string, @Req() req) {
const user = req.user;
return this.friendshipService.findOneFriend(relationshipId, user.username);
}
// @Get('myfriend/:relationshipId')
// @UseGuards(AuthenticateGuard)
// @UseGuards(TwoFactorGuard)
// findOneFriend(@Param('relationshipId') relationshipId: string, @Req() req) {
// console.log("Username " + relationshipId);
// const user = req.user;
// return this.friendshipService.findOneFriend(relationshipId, user.username);
// }
@Get('myfriends/:friendUsername')
@Get('myfriend/:friendUsername')
@UseGuards(AuthenticateGuard)
@UseGuards(TwoFactorGuard)
findOneRelationByUsername(@Param('friendUsername') friendUsername : string, @Req() req) {
console.log("Username " + friendUsername);
const user = req.user;
return this.friendshipService.findOneFriendByUsername(friendUsername, user.username);
}