Skip to content

Commit

Permalink
fix: 충돌 해결 - #77
Browse files Browse the repository at this point in the history
충돌 해결
  • Loading branch information
aaahyunseo authored Aug 18, 2024
2 parents a47ced5 + c0a6866 commit a639d45
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ public BoardData getBoardById(User user, String dormitory, UUID boardId) {
Board board = boardRepository.findBoardByDormitoryAndId(dormitoryType, boardId)
.orElseThrow(() -> new NotFoundException(ErrorCode.BOARD_NOT_FOUND));

boolean isLike = interestRepository.existsByUserAndBoard(user, board);
return BoardData.of(isLike, board);


// 기존의 BoardCategories를 가져와서 처리
List<BoardCategory> existingCategories = board.getBoardCategories();

Expand All @@ -65,7 +61,8 @@ public BoardData getBoardById(User user, String dormitory, UUID boardId) {
// 기존 리스트에 새로 생성한 카테고리 추가
existingCategories.addAll(boardCategories);

return BoardData.from(board);
boolean isLike = interestRepository.existsByUserAndBoard(user, board);
return BoardData.of(isLike, board);

}

Expand Down

0 comments on commit a639d45

Please sign in to comment.