Skip to content

Commit

Permalink
[merge] 모임 중복 신청 예외처리 수정
Browse files Browse the repository at this point in the history
[hotfix] 모임 중복 신청 예외처리 수정
  • Loading branch information
lreowy authored Jul 16, 2024
2 parents b4987fa + 2b4bc46 commit c7a4fd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.data.repository.query.Param;

public interface MoimSubmissionRepository extends JpaRepository<MoimSubmission, Long> {
boolean existsByMoimAndMoimSubmissionState(Moim moim, String moimSubmissionState);
boolean existsByMoimAndMoimSubmissionStateAndGuestId(Moim moim, String moimSubmissionState, Long guestId);

List<MoimSubmission> findAllByGuestId(Long guestId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public void createMoimSubmission(Long moimId, Long guestId, MoimSubmitRequest re
}

private void isDuplicatedMoimSubmission(MoimSubmission moimSubmission) {
if (moimSubmissionRepository.existsByMoimAndMoimSubmissionState(moimSubmission.getMoim(),
moimSubmission.getMoimSubmissionState())) {
if (moimSubmissionRepository.existsByMoimAndMoimSubmissionStateAndGuestId(moimSubmission.getMoim(),
moimSubmission.getMoimSubmissionState(), moimSubmission.getGuestId())) {
throw new BadRequestException(ErrorCode.DUPLICATION_MOIM_SUBMISSION);
}
}
Expand Down

0 comments on commit c7a4fd6

Please sign in to comment.