mirror of https://github.com/usbharu/Hideout.git
refactor: ifEmptyを使用するように
This commit is contained in:
parent
20a762b8f4
commit
5ae4d1577a
|
@ -26,10 +26,8 @@ class GetActorDetailApplicationService(
|
|||
actorRepository.findById(ActorId(command.id))
|
||||
?: throw IllegalArgumentException("Actor ${command.id} not found.")
|
||||
} else if (command.actorName != null) {
|
||||
val host = if (command.actorName.host.isEmpty()) {
|
||||
val host = command.actorName.host.ifEmpty {
|
||||
applicationConfig.url.host
|
||||
} else {
|
||||
command.actorName.host
|
||||
}
|
||||
actorRepository.findByNameAndDomain(command.actorName.userpart, host)
|
||||
?: throw IllegalArgumentException("Actor ${command.actorName} not found.")
|
||||
|
|
Loading…
Reference in New Issue