Skip to content

Commit

Permalink
Update EventService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Daolove0323 committed Nov 19, 2024
1 parent 9017dda commit 8367113
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public void delete(MemberIdentifier identifier, Long eventId) {
@Transactional
public void changeLeftSeat(Long eventId, Integer count) {
Event event = getByIdOrThrow(eventId);
if (count > 0 && event.getLeftSeat() < count) {
throw new NoLeftSeatException("남은 좌석이 부족합니다.");
if (event.getTotalSeat() < event.getLeftSeat() + count || event.getLeftSeat() + count < 0) {
throw new NoLeftSeatException("불가능한 접근입니다.");
}
event.decreaseLeftSeat(count);
}
Expand Down

0 comments on commit 8367113

Please sign in to comment.