Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Commit

Permalink
refactor: [#82] Rental 삭제 메소드 Null Safety 호출로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Habist committed Jul 25, 2021
1 parent b51b43c commit 08a96f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/campool/service/RentalService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RentalService(

@Transactional
fun deleteRental(rentalId: Long, userId: String) {
val rentalInfo = rentalMapper.findRentalInfoById(rentalId)!!
val rentalInfo = getRentalById(rentalId)
check(!(rentalInfo.status != RentalStatus.TRADEABLE || rentalInfo.userId != userId))
{ "본인이 등록하고 거래 가능 상태일 때만 삭제할 수 있습니다." }
rentalMapper.deleteById(rentalId)
Expand Down

0 comments on commit 08a96f7

Please sign in to comment.