Skip to content

Commit

Permalink
Merge pull request #243 from boostcampwm2023/BE-fix/default-board-image
Browse files Browse the repository at this point in the history
보드 기본 이미지 설정
  • Loading branch information
tnpfldyd authored Dec 11, 2023
2 parents 14b22db + 6a1759c commit 83ef00b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nestjs-BE/server/src/boards/boards.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from './swagger/boards.type';
import { FileInterceptor } from '@nestjs/platform-express';
import { UploadService } from 'src/upload/upload.service';
import customEnv from 'src/config/env';

const BOARD_EXPIRE_DAY = 7;

Expand Down Expand Up @@ -75,7 +76,9 @@ export class BoardsController {
createBoardDto.boardName,
createBoardDto.spaceId,
);
const imageUrl = image ? await this.uploadService.uploadFile(image) : null;
const imageUrl = image
? await this.uploadService.uploadFile(image)
: customEnv.APP_ICON_URL;
const document = await this.boardsService.create(createBoardDto, imageUrl);
const responseData = {
boardId: document.uuid,
Expand Down Expand Up @@ -123,7 +126,7 @@ export class BoardsController {
boardId: board.uuid,
boardName: board.boardName,
createdAt: board.createdAt,
imageUrl: board.imageUrl ? board.imageUrl : null,
imageUrl: board.imageUrl,
isDeleted,
});
return list;
Expand Down

0 comments on commit 83ef00b

Please sign in to comment.