Skip to content

Commit

Permalink
Avoid Reactor deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Apr 19, 2017
1 parent 611ff22 commit c8afdb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/mixit/web/handler/AdminHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand All @@ -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"))
}


Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"))
}
}

Expand All @@ -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(
Expand All @@ -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"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/mixit/web/handler/TicketingHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))) }
}
Expand Down

0 comments on commit c8afdb3

Please sign in to comment.