Skip to content

Commit e217b99

Browse files
committed
fix: 솜커톤 참가자 모집 API comment 해결
1 parent a37ee6f commit e217b99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/dmu/dasom/api/domain/somkathon/service/SomParticipantService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public SomParticipantResponseDto createParticipant(SomParticipantRequestDto requ
2323
throw new CustomException(ErrorCode.DUPLICATED_STUDENT_NO);
2424
}
2525

26+
somParticipantRepository.findByStudentId(requestDto.getStudentId())
27+
.orElseThrow(() -> new CustomException(ErrorCode.DUPLICATED_STUDENT_NO));
28+
2629
SomParticipant participant = SomParticipant.builder()
2730
.participantName(requestDto.getParticipantName())
2831
.studentId(requestDto.getStudentId())
@@ -78,7 +81,7 @@ public SomParticipantResponseDto updateParticipant(Long id, SomParticipantReques
7881
*/
7982
public void deleteParticipant(Long id) {
8083
if (!somParticipantRepository.existsById(id)) {
81-
throw new RuntimeException("참가자를 찾을 수 없습니다.");
84+
throw new CustomException(ErrorCode.NOT_FOUND_PARTICIPANT);
8285
}
8386
somParticipantRepository.deleteById(id);
8487
}

0 commit comments

Comments
 (0)