Skip to content

Commit

Permalink
refactor(BoardEmojiToggleResponseDto): 게시글 이모지 누르기/취소하기 api 응답에서 boar…
Browse files Browse the repository at this point in the history
…d category 추가
  • Loading branch information
mingmingmon committed Dec 21, 2024
1 parent 3dd26a8 commit 577a5ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
@Component
public class BoardEmojiDtoMapper {

public BoardEmojiToggleResponseDto toDto(BoardEmoji boardEmoji) {
public BoardEmojiToggleResponseDto toDto(BoardEmoji boardEmoji, String category) {
return BoardEmojiToggleResponseDto.builder()
.boardId(boardEmoji.getBoardId())
.category(category)
.emoji(boardEmoji.getEmoji())
.isDeleted(boardEmoji.getIsDeleted())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class BoardEmojiToggleResponseDto {

private Long boardId;
private String category;
private String emoji;
private Boolean isDeleted;
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public BoardEmojiToggleResponseDto toggleEmojiStatus(Long boardId, String emoji)
})
.orElseGet(() -> BoardEmoji.create(memberId, boardId, emoji));
registerBoardEmojiPort.save(boardEmoji);
return mapper.toDto(boardEmoji);
return mapper.toDto(boardEmoji, board.getCategory().getKey());
}
}

0 comments on commit 577a5ad

Please sign in to comment.