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 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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user