Clean code

This commit is contained in:
2020-01-28 22:35:50 +01:00
parent 813d6857e9
commit 41a98f23b8
24 changed files with 169 additions and 69 deletions

View File

@@ -78,7 +78,8 @@ fun Application.module(env: Env = PROD) {
convert<Article> {
decode { values, _ ->
values.singleOrNull()?.let {
get<RepositoryArticle>().findById(UUID.fromString(it)) ?: throw InternalError("Article $values not found")
get<RepositoryArticle>().findById(UUID.fromString(it))
?: throw InternalError("Article $values not found")
} ?: throw NotFoundException("Article $values not found")
}
}
@@ -157,7 +158,7 @@ fun Application.module(env: Env = PROD) {
}
install(Routing) {
// trace { application.log.trace(it.buildText()) }
// trace { application.log.trace(it.buildText()) }
authenticate(optional = true) {
article(get())
auth(get(), get(), get())