Skip to content

Commit

Permalink
chore: 교환 요청 추가할 때 교환 코인 예외처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimin0304 committed Nov 27, 2023
1 parent 39282ef commit 7d6a3ce
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public ExchangeRequestResponseDTO addExchangeRequest(Member member, long exchang
if (gifticon.isActive() == false || gifticon.isUsed() == true)
throw new BusinessException(ErrorCode.INACTIVE_GIFTION);

if (member.getExchangeCoin() < 1)
throw new BusinessException(ErrorCode.TOO_LITTLE_COIN);

ExchangePost exchangePost = exchangePostRepository.findById(exchangePostId)
.orElseThrow(() -> new EntityNotFoundException(ErrorCode.EXCHANGE_POST_NOT_FOUND));

Expand Down

0 comments on commit 7d6a3ce

Please sign in to comment.