diff --git a/src/main/java/com/team/cklob/gami/domain/mentoring/repository/ApplyRepository.java b/src/main/java/com/team/cklob/gami/domain/mentoring/repository/ApplyRepository.java index 2f6e1429..06cc1d8e 100644 --- a/src/main/java/com/team/cklob/gami/domain/mentoring/repository/ApplyRepository.java +++ b/src/main/java/com/team/cklob/gami/domain/mentoring/repository/ApplyRepository.java @@ -10,7 +10,7 @@ public interface ApplyRepository extends JpaRepository { - Boolean existsByMenteeIdAndMentorIdAndApplyStatusIn(Long menteeId, Long mentorId, List applyStatus); + Boolean existsByMenteeIdAndMentorIdAndApplyStatus(Long menteeId, Long mentorId, ApplyStatus applyStatus); @Query("SELECT a FROM Apply a JOIN FETCH a.mentor WHERE a.mentee.id = :menteeId AND a.applyStatus = :applyStatus ORDER BY a.createdAt DESC") List findAllByMenteeIdAndApplyStatusWithMentor(@Param("menteeId") Long menteeId, @Param("applyStatus") ApplyStatus applyStatus); diff --git a/src/main/java/com/team/cklob/gami/domain/mentoring/service/impl/MentoringApplyServiceImpl.java b/src/main/java/com/team/cklob/gami/domain/mentoring/service/impl/MentoringApplyServiceImpl.java index 9ab13e50..0e762217 100644 --- a/src/main/java/com/team/cklob/gami/domain/mentoring/service/impl/MentoringApplyServiceImpl.java +++ b/src/main/java/com/team/cklob/gami/domain/mentoring/service/impl/MentoringApplyServiceImpl.java @@ -41,7 +41,7 @@ public MentoringApplyResponse execute(Long mentorId) { throw new SelfApplyNotAllowedException(); } - if (applyRepository.existsByMenteeIdAndMentorIdAndApplyStatusIn(mentee.getId(), mentor.getId(), List.of(ApplyStatus.PENDING, ApplyStatus.ACCEPTED))) { + if (applyRepository.existsByMenteeIdAndMentorIdAndApplyStatus(mentee.getId(), mentor.getId(), ApplyStatus.PENDING)) { throw new AlreadyRegisteredMentorException(); }