Handle 404 for notes
This commit is contained in:
parent
fc883373d0
commit
fda355a690
@ -32,8 +32,13 @@ class NoteController(
|
|||||||
|
|
||||||
suspend fun renderOne(call: ApplicationCall) {
|
suspend fun renderOne(call: ApplicationCall) {
|
||||||
val uuidParam = call.parameters["uuid"]
|
val uuidParam = call.parameters["uuid"]
|
||||||
val uuid = UUID.fromString(uuidParam)
|
|
||||||
val note = noteRepository.find(userId = 1, noteUuid = uuid)
|
val uuid = try {
|
||||||
|
UUID.fromString(uuidParam)
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val note = noteRepository.find(userId = 1, noteUuid = uuid) ?: return
|
||||||
val template = templates.get("_uuid.html")
|
val template = templates.get("_uuid.html")
|
||||||
call.respondKorte(template, "note" to note)
|
call.respondKorte(template, "note" to note)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user