Skip to content

Commit

Permalink
RAC-231 fix : 삭제된 후배/선배 연관 멘토링 상세 조회 막음
Browse files Browse the repository at this point in the history
  • Loading branch information
ywj9811 committed Dec 14, 2023
1 parent 901183d commit 9e87f83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Optional;

public interface MentoringRepository extends JpaRepository<Mentoring, Long> {
Optional<Mentoring> findByMentoringId(Long mentoringId);
Optional<Mentoring> findByMentoringIdAndUser_IsDeleteAndSenior_User_IsDelete(Long mentoringId, Boolean isUserDelete, Boolean isSeniorDelete);
List<Mentoring> findAllByUserAndStatusAndSenior_User_IsDelete(User user, Status status, Boolean isDelete);
List<Mentoring> findAllBySeniorAndStatusAndUser_IsDelete(Senior senior, Status status, Boolean isDelete);
List<Mentoring> findAllByStatusAndCreatedAtIsBefore(Status status, LocalDate now);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public List<Mentoring> mentoringBySenior(Senior senior, Status status) {
}

public Mentoring byMentoringId(Long mentoringId) {
return mentoringRepository.findByMentoringId(mentoringId).orElseThrow(MentoringNotFoundException::new);
return mentoringRepository.findByMentoringIdAndUser_IsDeleteAndSenior_User_IsDelete(mentoringId, FALSE, FALSE)
.orElseThrow(MentoringNotFoundException::new);
}

public List<Mentoring> byStatusAndCreatedAt(Status status, LocalDate now) {
Expand Down

0 comments on commit 9e87f83

Please sign in to comment.