Skip to content

Commit

Permalink
update: 채팅 내 게시물 가져오기API에 게시글 차단한 경우 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jjunjji committed Sep 19, 2023
1 parent c4ee4ea commit 73e8d1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/back/handsUp/service/ChatService.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ public ChatDto.ResBoardPreview getPreViewBoard(Principal principal, Long boardId
}
BoardUser boardUser = optional2.get();

//차단 확인
Optional<BoardUser> blockBoard = this.boardUserRepository.findBoardUserByBoardIdxAndStatus(board, "BLOCK")
.stream().findFirst();

if(blockBoard.isPresent()){
throw new BaseException(BaseResponseStatus.BLOCKED_BOARD_ERROR);
}

ChatDto.ResBoardPreview boardPreview = ChatDto.ResBoardPreview.builder()
.board(board)
.tag(tagName)
Expand Down

0 comments on commit 73e8d1b

Please sign in to comment.