Skip to content

Commit

Permalink
Merge pull request #446 from boostcampwm2023/BE-hotfix
Browse files Browse the repository at this point in the history
[BE/hotfix] BlockUser 기본 이미지 처리
  • Loading branch information
koomin1227 authored Dec 10, 2023
2 parents 7579fe0 + 6dbf83c commit f572d63
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 f572d63

Please sign in to comment.