Skip to content

Commit

Permalink
[BE] Fix : UsersBlock 기본 이미지 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
namewhat99 committed Dec 10, 2023
1 parent 7579fe0 commit 6dbf83c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion BE/src/users-block/users-block.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -11,6 +12,7 @@ export class UsersBlockService {
private blockUserRepository: Repository<BlockUserEntity>,
@InjectRepository(UserEntity)
private userRepository: Repository<UserEntity>,
private configService: ConfigService,
) {}

async addBlockUser(id: string, userId: string) {
Expand Down Expand Up @@ -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,
};

Expand Down

0 comments on commit 6dbf83c

Please sign in to comment.