From ed0c0e03f7944f266c4544c27fe874d306d5332f Mon Sep 17 00:00:00 2001 From: kmi0817 Date: Fri, 19 Apr 2024 23:52:07 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20blocker=EB=A5=BC=20=EA=B8=B0=EC=A4=80?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=B0=A8=EB=8B=A8=20=EB=82=B4=EC=97=AD=20?= =?UTF-8?q?=EC=B0=BE=EB=8A=94=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/block.repository.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BE/src/users/block.repository.ts b/BE/src/users/block.repository.ts index 5f23129..6a92f95 100644 --- a/BE/src/users/block.repository.ts +++ b/BE/src/users/block.repository.ts @@ -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')