changement mineur fonction pour chercher ami via username
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user