Skip to content

Commit

Permalink
feat: 친구 일기 조회 isPublic 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
HyeJiJUN committed Nov 5, 2024
1 parent 4ed8d30 commit 8e785ec
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public FriendDiaryResponse getFriendDiary(Long memberId, Long diaryId) {
Diary diary = diaryRepository.findById(diaryId)
.orElseThrow(() -> new GlobalException(ErrorCode.DIARY_NOT_FOUND));

if(!diary.isPublic()){
throw new GlobalException(ErrorCode.DIARY_NOT_PUBLIC);
}

//글쓴사람이 친구인지 확인
Member currentMember = memberRepository.findById(memberId)
.orElseThrow(() -> new GlobalException(ErrorCode.MEMBER_NOT_FOUND));
Expand Down

0 comments on commit 8e785ec

Please sign in to comment.