Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 스팟 생성 유저가 자신의 스팟에 참여 시 예외처리 #115

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public CreateOrderDetailRes participantOrder(Member member, CreateOrderDetailReq
simpleSpotRepository
.findById(dto.getSpotId())
.orElseThrow(() -> new IllegalArgumentException("스팟 정보가 없습니다."));

if (member.getId().equals(spot.getMember().getId()))
throw new IllegalArgumentException("방장입니다.(참여자만 사용 가능)");

OrderDetail orderDetail =
orderDetailRepository.save(
OrderDetail.builder()
Expand Down