We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3622e1 commit ef19105Copy full SHA for ef19105
src/main/kotlin/application/service/Service.kt
@@ -34,7 +34,10 @@ object Service {
34
* Application Service that has the objective of creating a [room] using the provided [roomRepository].
35
*/
36
class CreateRoom(private val room: Room, private val roomRepository: RoomRepository) : ApplicationService<Room?> {
37
- override fun execute(): Room? = this.roomRepository.createRoom(room)
+ override fun execute(): Room? =
38
+ if (this.roomRepository.findBy(room.id, null) == null) {
39
+ this.roomRepository.createRoom(room)
40
+ } else null
41
}
42
43
/**
0 commit comments