corrections mineures

This commit is contained in:
batche
2022-12-09 11:29:19 +01:00
parent 58787215ad
commit 3802973dfa

View File

@@ -48,7 +48,6 @@ export class FriendshipService {
return await this.friendshipRepository return await this.friendshipRepository
.createQueryBuilder('friendship') .createQueryBuilder('friendship')
.where('friendship.requesterUsername = :requestee', { requestee: username }) .where('friendship.requesterUsername = :requestee', { requestee: username })
.orWhere('friendship.addresseeUsername = :addressee', { addressee: username })
.andWhere('friendship.status = :status', { status: FriendshipStatus.BLOCKED }) .andWhere('friendship.status = :status', { status: FriendshipStatus.BLOCKED })
.getMany(); .getMany();
} }
@@ -70,7 +69,7 @@ export class FriendshipService {
} }
//GROS CHANTIER //GROS CHANTIER
async create(createFriendshipDto: CreateFriendshipDto, creator : User) { async create(createFriendshipDto: CreateFriendshipDto, creator : User) {
const addressee = await this.userRepository.findOneBy({ id: +createFriendshipDto.addresseeUsername }); const addressee = await ;
if (!addressee) if (!addressee)
throw new HttpException(`The addressee does not exist.`, HttpStatus.NOT_FOUND); throw new HttpException(`The addressee does not exist.`, HttpStatus.NOT_FOUND);
if (creator.id === addressee.id) if (creator.id === addressee.id)