From 5b5b33df4d9d74c0e351c87b64a5f2402da24e66 Mon Sep 17 00:00:00 2001 From: Yerin Lee <91695537+lxxyxin@users.noreply.github.com> Date: Thu, 18 Jul 2024 23:57:43 +0900 Subject: [PATCH] =?UTF-8?q?hotfix=20:=20=EB=AA=A8=EC=9E=84=20=EC=8B=A0?= =?UTF-8?q?=EC=B2=AD=20=EC=8B=9C=20pendingApproval=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moimsubmission/repository/MoimSubmissionRepository.java | 2 +- .../service/MoimSubmissionCommandService.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java b/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java index 88be28ed..5cb4dec4 100644 --- a/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java +++ b/src/main/java/com/pickple/server/api/moimsubmission/repository/MoimSubmissionRepository.java @@ -8,7 +8,7 @@ import org.springframework.data.repository.query.Param; public interface MoimSubmissionRepository extends JpaRepository { - boolean existsByMoimAndMoimSubmissionStateAndGuestId(Moim moim, String moimSubmissionState, Long guestId); + boolean existsByMoimAndGuestId(Moim moim, Long guestId); List findAllByGuestId(Long guestId); diff --git a/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java b/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java index 29cddc0c..5a60d7e8 100644 --- a/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java +++ b/src/main/java/com/pickple/server/api/moimsubmission/service/MoimSubmissionCommandService.java @@ -28,15 +28,15 @@ public void createMoimSubmission(Long moimId, Long guestId, MoimSubmitRequest re .moim(moim) .answerList(request.answerList()) .accountList(request.accountList()) - .moimSubmissionState(MoimSubmissionState.PENDING_PAYMENT.getMoimSubmissionState()) + .moimSubmissionState(MoimSubmissionState.PENDING_APPROVAL.getMoimSubmissionState()) .build(); isDuplicatedMoimSubmission(moimSubmission); moimSubmissionRepository.save(moimSubmission); } private void isDuplicatedMoimSubmission(MoimSubmission moimSubmission) { - if (moimSubmissionRepository.existsByMoimAndMoimSubmissionStateAndGuestId(moimSubmission.getMoim(), - moimSubmission.getMoimSubmissionState(), moimSubmission.getGuestId())) { + if (moimSubmissionRepository.existsByMoimAndGuestId(moimSubmission.getMoim(), + moimSubmission.getGuestId())) { throw new BadRequestException(ErrorCode.DUPLICATION_MOIM_SUBMISSION); } }