diff --git a/src/main/kotlin/mixit/web/handler/AdminHandler.kt b/src/main/kotlin/mixit/web/handler/AdminHandler.kt index 1aafd948..c4ccaa27 100644 --- a/src/main/kotlin/mixit/web/handler/AdminHandler.kt +++ b/src/main/kotlin/mixit/web/handler/AdminHandler.kt @@ -81,7 +81,7 @@ class AdminHandler(val ticketRepository: TicketRepository, start = LocalDateTime.parse(formData["start"]), end = LocalDateTime.parse(formData["end"]) ) - talkRepository.save(talk).then { seeOther("${properties.baseUri}/admin/talks") } + talkRepository.save(talk).then(seeOther("${properties.baseUri}/admin/talks")) } } @@ -90,7 +90,7 @@ class AdminHandler(val ticketRepository: TicketRepository, val formData = it.toSingleValueMap() talkRepository .deleteOne(formData["id"]!!) - .then { seeOther("${properties.baseUri}/admin/talks") } + .then(seeOther("${properties.baseUri}/admin/talks")) } @@ -141,7 +141,7 @@ class AdminHandler(val ticketRepository: TicketRepository, val formData = it.toSingleValueMap() userRepository .deleteOne(formData["login"]!!) - .then { seeOther("${properties.baseUri}/admin/users") } + .then(seeOther("${properties.baseUri}/admin/users")) } private fun adminUser(user: User = User("", "", "", "")) = ok().render("admin-user", mapOf( @@ -172,7 +172,7 @@ class AdminHandler(val ticketRepository: TicketRepository, links = formData["links"]!!.toLinks(), legacyId = if (formData["legacyId"] == "") null else formData["legacyId"]!!.toLong() ) - userRepository.save(user).then { seeOther("${properties.baseUri}/admin/users") } + userRepository.save(user).then(seeOther("${properties.baseUri}/admin/users")) } } @@ -194,7 +194,7 @@ class AdminHandler(val ticketRepository: TicketRepository, val formData = it.toSingleValueMap() postRepository .deleteOne(formData["id"]!!) - .then { seeOther("${properties.baseUri}/admin/blog") } + .then(seeOther("${properties.baseUri}/admin/blog")) } private fun adminPost(post: Post = Post("")) = ok().render("admin-post", mapOf( @@ -219,7 +219,7 @@ class AdminHandler(val ticketRepository: TicketRepository, headline = mapOf(Pair(FRENCH, formData["headline-fr"]!!), Pair(ENGLISH, formData["headline-en"]!!)), content = mapOf(Pair(FRENCH, formData["content-fr"]!!), Pair(ENGLISH, formData["content-en"]!!)) ) - postRepository.save(post).then { seeOther("${properties.baseUri}/admin/blog") } + postRepository.save(post).then(seeOther("${properties.baseUri}/admin/blog")) } } diff --git a/src/main/kotlin/mixit/web/handler/TicketingHandler.kt b/src/main/kotlin/mixit/web/handler/TicketingHandler.kt index 5635d601..5cf093a5 100644 --- a/src/main/kotlin/mixit/web/handler/TicketingHandler.kt +++ b/src/main/kotlin/mixit/web/handler/TicketingHandler.kt @@ -21,7 +21,7 @@ class TicketingHandler(val repository: TicketRepository) { formData["firstname"]!!, formData["lastname"]!!) repository.save(ticket) - .then { ok().render("ticketing-submission", formData) } + .then(ok().render("ticketing-submission", formData)) .onErrorResume(DuplicateKeyException::class, { ok().render("ticketing-error", mapOf(Pair("message", "ticketing.error.alreadyexists"), Pair("title", "ticketing.title"))) } ) .onErrorResume { ok().render("ticketing-error", mapOf(Pair("message", "ticketing.error.default"), Pair("title", "ticketing.title"))) } }