Skip to content

Commit

Permalink
feat: blocker를 기준으로 차단 내역 찾는 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kmi0817 committed Apr 19, 2024
1 parent bbd297c commit ed0c0e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions BE/src/users/block.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ export class BlockRepository {
return this.blockRepository.save({ blocker, blocked });
}

findByBlocker(blocker: string) {
return this.blockRepository
.createQueryBuilder('b')
.leftJoinAndSelect('b.blocker', 'x')
.leftJoinAndSelect('b.blocked', 'y')
.where('b.blocker = :blocker', { blocker })
.getMany();
}

findByBlockerAndBlocked(blocker: string, blocked: string) {
return this.blockRepository
.createQueryBuilder('b')
Expand Down

0 comments on commit ed0c0e0

Please sign in to comment.