Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public interface ApplyRepository extends JpaRepository<Apply, Long> {

Boolean existsByMenteeIdAndMentorIdAndApplyStatusIn(Long menteeId, Long mentorId, List<ApplyStatus> 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<Apply> findAllByMenteeIdAndApplyStatusWithMentor(@Param("menteeId") Long menteeId, @Param("applyStatus") ApplyStatus applyStatus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Comment thread
cfcromn marked this conversation as resolved.
throw new AlreadyRegisteredMentorException();
}

Expand Down