From 4c4ffa0ad2e639fccb1350eb1d623f20fc6bdd52 Mon Sep 17 00:00:00 2001 From: zynoobb <117588482+zynoobb@users.noreply.github.com> Date: Wed, 12 Apr 2023 13:53:11 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20blocks.service=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nestjs/src/blocks/blocks.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nestjs/src/blocks/blocks.service.ts b/nestjs/src/blocks/blocks.service.ts index 862d3ca..4fb02e9 100644 --- a/nestjs/src/blocks/blocks.service.ts +++ b/nestjs/src/blocks/blocks.service.ts @@ -27,6 +27,7 @@ export class BlockUserService { id: userId, }, }, + relations: ["blocked_user", "blocker"], }); } @@ -90,11 +91,14 @@ export class BlockUserService { } async deleteBlock({ id, blockerId }: IBlcosServiceDelete): Promise { - const isVerify = await this.findOneByIdAndBlockerId({ id, blockerId }); + const isVerify = await this.findOneByBlockerIdAndBlockedUserId({ + blockerId, + blockedUserId: id, + }); if (!isVerify) throw new NotAcceptableException(); - const result = await this.blocksRepository.delete({ id }); + const result = await this.blocksRepository.delete({ id: isVerify.id }); return result.affected ? true : false; }