From f00038e1918cd612b86d242b8aac532704f4bf87 Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Wed, 13 Dec 2023 15:42:57 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[BE]=20Feat=20:=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EB=90=9C=20=EC=9C=A0=EC=A0=80=EB=A5=BC=20=EC=B0=A8=EB=8B=A8?= =?UTF-8?q?=ED=95=9C=20=EA=B2=83=EC=97=90=20=EB=8C=80=ED=95=B4=EC=84=9C?= =?UTF-8?q?=EB=8F=84=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20=ED=95=84=ED=84=B0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/post/post.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/BE/src/post/post.service.ts b/BE/src/post/post.service.ts index 85abee6..0948a96 100644 --- a/BE/src/post/post.service.ts +++ b/BE/src/post/post.service.ts @@ -50,6 +50,7 @@ export class PostService { await this.blockUserRepository.find({ where: { blocker: userId }, relations: ['blockedUser'], + withDeleted: true, }) ).map((blockedUser) => blockedUser.blockedUser.user_hash); From 3921feb6d107bc2afe0b864a79723201ce660702 Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Wed, 13 Dec 2023 15:43:35 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[BE]=20Feat=20:=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=ED=83=88=ED=87=B4=EC=8B=9C=20=ED=95=B4=EB=8B=B9=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=EB=A5=BC=20=EC=B0=A8=EB=8B=A8=ED=95=9C=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EB=8A=94=20=EC=82=AD=EC=A0=9C=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users/users.service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/BE/src/users/users.service.ts b/BE/src/users/users.service.ts index 13a3d0b..75a7ad0 100644 --- a/BE/src/users/users.service.ts +++ b/BE/src/users/users.service.ts @@ -73,7 +73,6 @@ export class UsersService { async deleteCascadingUser(userId, userHash) { await this.blockPostRepository.softDelete({ blocker: userHash }); await this.blockUserRepository.softDelete({ blocker: userHash }); - await this.blockUserRepository.softDelete({ blocked_user: userHash }); await this.userRepository.softDelete({ id: userId }); } From 04eb27adc935a1aeedb0f48649c41e552b74b79a Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Wed, 13 Dec 2023 15:45:12 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[BE]=20Feat=20:=20=ED=83=88=ED=87=B4?= =?UTF-8?q?=ED=95=9C=20=ED=9A=8C=EC=9B=90=EC=97=90=20=EB=8C=80=ED=95=B4?= =?UTF-8?q?=EC=84=9C=EB=8F=84=20=EC=B0=A8=EB=8B=A8=20=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users-block/users-block.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/BE/src/users-block/users-block.service.ts b/BE/src/users-block/users-block.service.ts index 409b9c2..82fa52f 100644 --- a/BE/src/users-block/users-block.service.ts +++ b/BE/src/users-block/users-block.service.ts @@ -18,6 +18,7 @@ export class UsersBlockService { async addBlockUser(id: string, userId: string) { const isExistUser = await this.userRepository.findOne({ where: { user_hash: id }, + withDeleted: true, }); if (!isExistUser) { From b962cc53b633c672eb0ca6b1a39ba625e86840cc Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Wed, 13 Dec 2023 16:00:01 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[BE]=20Feat=20:=20=ED=83=88=ED=87=B4?= =?UTF-8?q?=ED=95=9C=20=ED=9A=8C=EC=9B=90=EC=9D=84=20=EC=B0=A8=EB=8B=A8?= =?UTF-8?q?=ED=9B=84=20=EC=A1=B0=ED=9A=8C=ED=96=88=EC=9D=84=20=EB=95=8C=20?= =?UTF-8?q?null=20=EB=B0=98=ED=99=98=ED=95=98=EA=B2=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users-block/users-block.service.ts | 24 ++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/BE/src/users-block/users-block.service.ts b/BE/src/users-block/users-block.service.ts index 82fa52f..8035785 100644 --- a/BE/src/users-block/users-block.service.ts +++ b/BE/src/users-block/users-block.service.ts @@ -5,6 +5,12 @@ import { Repository } from 'typeorm'; import { UserEntity } from 'src/entities/user.entity'; import { ConfigService } from '@nestjs/config'; +interface BlockedUser { + user_id: string; + nickname?: string; + profile_img?: string; +} + @Injectable() export class UsersBlockService { constructor( @@ -52,15 +58,19 @@ export class UsersBlockService { }); const blockedUsers = res.reduce((acc, cur) => { - const user = { - nickname: cur.blockedUser.nickname, - profile_img: + const user: BlockedUser = { + user_id: cur.blocked_user, + }; + if (cur.blockedUser === null) { + user.nickname = null; + user.profile_img = null; + } else { + user.nickname = cur.blockedUser.nickname; + user.profile_img = cur.blockedUser.profile_img === null ? this.configService.get('DEFAULT_PROFILE_IMAGE') - : cur.blockedUser.profile_img, - user_id: cur.blockedUser.user_hash, - }; - + : cur.blockedUser.profile_img; + } acc.push(user); return acc; }, []);