Stuggling a bit to get components to rerender when a prop updates in the Friendship page, will sort out tomorrow

This commit is contained in:
Me
2022-12-11 08:12:22 +01:00
parent 6eeb2b5474
commit db1e269e2e
5 changed files with 108 additions and 63 deletions

View File

@@ -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

View File

@@ -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)