From 053a175a3f42257793a9722cba83e74b08602161 Mon Sep 17 00:00:00 2001 From: sunga Date: Sun, 17 Sep 2023 16:42:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=82=AB=ED=88=AC=EB=91=90=207=EA=B0=9C?= =?UTF-8?q?=20=EC=A0=9C=ED=95=9C=20=EC=A2=85=EB=A3=8C=EB=90=9C=20=EB=82=AB?= =?UTF-8?q?=ED=88=AC=EB=91=90=20=EC=A0=9C=EC=99=B8=20=EC=B9=B4=EC=9A=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=BF=BC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nottodo/repository/UserNotToDoJpaRepository.java | 3 +++ .../domain_name/nottodo/service/NotToDoService.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/bside/NotToDoClub/domain_name/nottodo/repository/UserNotToDoJpaRepository.java b/src/main/java/bside/NotToDoClub/domain_name/nottodo/repository/UserNotToDoJpaRepository.java index 5ee288f..dbe4887 100644 --- a/src/main/java/bside/NotToDoClub/domain_name/nottodo/repository/UserNotToDoJpaRepository.java +++ b/src/main/java/bside/NotToDoClub/domain_name/nottodo/repository/UserNotToDoJpaRepository.java @@ -27,6 +27,9 @@ public interface UserNotToDoJpaRepository extends JpaRepository= current_date") + int countUserNotToDoLimitCheck(Long userId); + @Query("select n from UserNotToDo n " + "join fetch n.moderationRecords " + "where n.progressState = :progressState" diff --git a/src/main/java/bside/NotToDoClub/domain_name/nottodo/service/NotToDoService.java b/src/main/java/bside/NotToDoClub/domain_name/nottodo/service/NotToDoService.java index c1edb65..4da21a5 100644 --- a/src/main/java/bside/NotToDoClub/domain_name/nottodo/service/NotToDoService.java +++ b/src/main/java/bside/NotToDoClub/domain_name/nottodo/service/NotToDoService.java @@ -50,7 +50,7 @@ public NotToDoCreateResponseDto createNotToDo(String accessToken, NotToDoCreateR () -> new CustomException(ErrorCode.USER_NOT_FOUND) ); - int cnt = userNotToDoRepository.countUserNotToDoByUserIdAndUseYn(user.getId()); + int cnt = userNotToDoRepository.countUserNotToDoLimitCheck(user.getId()); if(cnt >= 7){ throw new CustomException(ErrorCode.REGISTER_NOT_TO_DO_LIMIT); }