Skip to content

Commit

Permalink
[FIX] 개인 대시보드 조회에서 없는 유저로 요청할 시, 에러 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
yeseul106 committed Jul 18, 2023
1 parent 3e8b6be commit c494bfb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public ProjectOwnPuzzleResponseDto getMyPuzzles(Long memberId, Long projectId, S
throw new BadRequestException(ErrorStatus.VALIDATION_REQUEST_MISSING_EXCEPTION.getMessage());
}

if (findMemberById(memberId) == null) {
throw new BadRequestException(ErrorStatus.NOT_FOUND_MEMBER.getMessage());
}

Pageable pageable = PageRequest.of(0, 15); // 첫 번째 페이지, 페이지 크기 15
Page<Review> pageReviews = reviewRepository.findTop15ByMemberIdAndProjectId(memberId, projectId, pageable);
List<Review> top15Reviews = pageReviews.getContent();

if (top15Reviews.isEmpty()) {
throw new NotFoundException(ErrorStatus.NOT_FOUND_USER_PROJECT.getMessage());
}

Boolean isReviewDay = checkTodayIsReviewDay(today, findProjectById(projectId).getReviewCycle());
Boolean hasTodayReview = reviewRepository.existsReviewByReviewDate(today);

Expand Down

0 comments on commit c494bfb

Please sign in to comment.