Skip to content

Commit

Permalink
chore: accept place closed
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoo0515 committed Oct 10, 2024
1 parent 99132c5 commit 60e3bfe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ class AcceptClosedPlaceCandidateUseCase(
fun handle(candidateId: String) = transactionManager.doInTransaction {
val candidate = closedPlaceCandidateRepository.findByIdOrNull(candidateId)
?: throw IllegalArgumentException("closed place candidate with id($candidateId) not found")
val place = placeRepository.findByIdOrNull(candidate.placeId)!!

candidate.accept()
closedPlaceCandidateRepository.save(candidate)
place.setIsClosed(true)
placeRepository.save(place)

val place = placeRepository.findByIdOrNull(candidate.placeId)!!
return@doInTransaction NamedClosedPlaceCandidate(
candidateId = candidate.id,
placeId = place.id,
Expand Down

0 comments on commit 60e3bfe

Please sign in to comment.