From 5310e978b4242ca3815761a62d82b423a01a55cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=ED=95=98=EB=AF=BC?= Date: Mon, 29 Dec 2025 22:19:50 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20::=20=EB=A9=94=EC=86=8C=EB=93=9C=20?= =?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cklob/gami/domain/mentoring/repository/ApplyRepository.java | 2 +- .../mentoring/service/impl/MentoringApplyServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(); }