Skip to content

Commit

Permalink
πŸ› fix: Boolean isLiked μžλ£Œν˜• λ³€κ²½
Browse files Browse the repository at this point in the history
  • Loading branch information
jinho7 committed Aug 17, 2024
1 parent 99cf1b5 commit ba7a42e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public static class BoardDTO {
private String content;
private Category category;
private HelpStatus helpStatus;
private Boolean isAuthor;
private Boolean isLiked;
private boolean isAuthor;
private boolean isLiked;
private Integer likeNum;
private Integer commentCount;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
private List<String> images;

public static BoardDTO from(Board board, Long currentMemberId, Boolean isLiked) {
public static BoardDTO from(Board board, Long currentMemberId, boolean isLiked) {
return BoardDTO.builder()
.id(board.getId())
.memberId(board.getMember().getId())
Expand Down Expand Up @@ -100,7 +100,7 @@ public static class BoardLikeDTO {
private boolean isLiked;
private Integer likeCount;

public static BoardLikeDTO from(Board board, Long currentMemberId, Boolean isLiked) {
public static BoardLikeDTO from(Board board, Long currentMemberId, boolean isLiked) {
return BoardLikeDTO.builder()
.memberId(currentMemberId)
.boardId(board.getId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public BoardResponseDTO.BoardDTO updateBoard(Long boardId,
}
}
Board updatedBoard = boardRepository.save(board);
Boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, updatedBoard);
boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, updatedBoard);
return BoardResponseDTO.BoardDTO.from(updatedBoard, member.getId(), isLiked);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public BoardResponseDTO.BoardDTO getBoardDetail(Long boardId, Member member) {
Board board = boardRepository.findById(boardId)
.orElseThrow(() -> new BoardException(BoardErrorCode.BOARD_NOT_FOUND));

Boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, board);
boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, board);
return BoardResponseDTO.BoardDTO.from(board, member.getId(), isLiked);
}

Expand Down

0 comments on commit ba7a42e

Please sign in to comment.