diff --git a/src/main/java/univ/yesummit/domain/board/application/BoardService.java b/src/main/java/univ/yesummit/domain/board/application/BoardService.java index e635d94..db393d3 100644 --- a/src/main/java/univ/yesummit/domain/board/application/BoardService.java +++ b/src/main/java/univ/yesummit/domain/board/application/BoardService.java @@ -80,17 +80,14 @@ public BoardInfoResDto boardInfo(Long boardId) { // (내가 작성한) 게시글 한개 조회 @Transactional - public BoardInfoResDto myBoardInfo(Long memberId, Long boardId) { + public BoardInfoResDto myBoardInfo(Long memberId) { Member member = memberRepository.findById(memberId) .orElseThrow(() -> new IllegalArgumentException("회원이 존재하지 않습니다.")); - Board board = boardRepository.findById(boardId) + Board board = boardRepository.findFirstByWriter(member) .orElseThrow(() -> new IllegalArgumentException("게시글이 존재하지 않습니다.")); - checkBoardOwnership(member, board); - boolean isLike = boardLikeRepository.existsByBoardAndMember(board, member); - return BoardInfoResDto.of(member, board, isLike); } @@ -148,4 +145,4 @@ public Board findById(Long boardId) { return boardRepository.findById(boardId) .orElseThrow(() -> new IllegalArgumentException("게시글이 존재하지 않습니다.")); } -} \ No newline at end of file +}