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 http://transcendance:8080/api/v2/network/myfriends/relationshipId
@Get('myfriend/:relationshipId') // @Get('myfriend/:relationshipId')
@UseGuards(AuthenticateGuard) // @UseGuards(AuthenticateGuard)
@UseGuards(TwoFactorGuard) // @UseGuards(TwoFactorGuard)
findOneFriend(@Param('relationshipId') relationshipId: string, @Req() req) { // findOneFriend(@Param('relationshipId') relationshipId: string, @Req() req) {
const user = req.user; // console.log("Username " + relationshipId);
return this.friendshipService.findOneFriend(relationshipId, user.username); // const user = req.user;
} // return this.friendshipService.findOneFriend(relationshipId, user.username);
// }
@Get('myfriends/:friendUsername') @Get('myfriend/:friendUsername')
@UseGuards(AuthenticateGuard) @UseGuards(AuthenticateGuard)
@UseGuards(TwoFactorGuard) @UseGuards(TwoFactorGuard)
findOneRelationByUsername(@Param('friendUsername') friendUsername : string, @Req() req) { findOneRelationByUsername(@Param('friendUsername') friendUsername : string, @Req() req) {
console.log("Username " + friendUsername);
const user = req.user; const user = req.user;
return this.friendshipService.findOneFriendByUsername(friendUsername, user.username); return this.friendshipService.findOneFriendByUsername(friendUsername, user.username);
} }