Main Display
- {#if userToDisplay !== undefined} -- -
diff --git a/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts b/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts index 57377aa1..552a35a9 100644 --- a/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts +++ b/srcs/requirements/nestjs/api_back/src/friendship/friendship.controller.ts @@ -12,12 +12,14 @@ export class FriendshipController { @Get('myfriends') @UseGuards(AuthenticateGuard) @UseGuards(TwoFactorGuard) - findEmpty(@Req() req) { + findEmpty(@Query('username') username: string, @Req() req) { const user = req.user; + if (username === undefined) { + console.log("WHAT IS UP MY GUYS IT IS YOUR BOI THAT IDIOT YOU HATE 11111"); + return this.friendshipService.findAllFriends(user.id); + } else { - console.log("WHAT IS UP MY GUYS IT IS YOUR BOI THAT IDIOT YOU HATE 11111"); - - return this.friendshipService.findAllFriends(user.id); + } } // GET http://transcendance:8080/api/v2/network/myfriends/relationshipId diff --git a/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts b/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts index 5e141f50..d4288d9a 100644 --- a/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts +++ b/srcs/requirements/nestjs/api_back/src/friendship/friendship.service.ts @@ -23,6 +23,13 @@ export class FriendshipService { return friendship; } + // async findOneFriendByUsername(friendUsername: string, username: string) { + // const friendship = await this.friendshipRepository.find({ where: { friendUsername: +friendshipId, requesterUsername: username, status: FriendshipStatus.ACCEPTED } }); + // if (!friendship) + // throw new HttpException(`The requested friend not found.`, HttpStatus.NOT_FOUND); + // return friendship; + // } + async findOneBlocked(friendshipId: string) { const friendship = await this.friendshipRepository.find({ where: { id: +friendshipId, status: FriendshipStatus.BLOCKED } }); if (!friendship) diff --git a/srcs/requirements/svelte/api_front/src/pages/profile/ProfileFriends.svelte b/srcs/requirements/svelte/api_front/src/pages/profile/ProfileFriends.svelte index 483cae00..f6175a0c 100644 --- a/srcs/requirements/svelte/api_front/src/pages/profile/ProfileFriends.svelte +++ b/srcs/requirements/svelte/api_front/src/pages/profile/ProfileFriends.svelte @@ -1,6 +1,7 @@ @@ -166,7 +154,7 @@ could be a list of friends and if they're active but i can't see that yet {#each allUsers as aUser } -