From 6dbf83c825cc1db915c37744ba86c9447ba5819b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=84=80=E1=85=AA=E1=86=BC=E1=84=92?= =?UTF-8?q?=E1=85=AE=E1=86=AB?= Date: Sun, 10 Dec 2023 20:03:00 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20Fix=20:=20UsersBlock=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/users-block/users-block.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BE/src/users-block/users-block.service.ts b/BE/src/users-block/users-block.service.ts index c697962..409b9c2 100644 --- a/BE/src/users-block/users-block.service.ts +++ b/BE/src/users-block/users-block.service.ts @@ -3,6 +3,7 @@ import { InjectRepository } from '@nestjs/typeorm'; import { BlockUserEntity } from 'src/entities/blockUser.entity'; import { Repository } from 'typeorm'; import { UserEntity } from 'src/entities/user.entity'; +import { ConfigService } from '@nestjs/config'; @Injectable() export class UsersBlockService { @@ -11,6 +12,7 @@ export class UsersBlockService { private blockUserRepository: Repository, @InjectRepository(UserEntity) private userRepository: Repository, + private configService: ConfigService, ) {} async addBlockUser(id: string, userId: string) { @@ -51,7 +53,10 @@ export class UsersBlockService { const blockedUsers = res.reduce((acc, cur) => { const user = { nickname: cur.blockedUser.nickname, - profile_img: cur.blockedUser.profile_img, + profile_img: + cur.blockedUser.profile_img === null + ? this.configService.get('DEFAULT_PROFILE_IMAGE') + : cur.blockedUser.profile_img, user_id: cur.blockedUser.user_hash, };