diff --git a/api/src/routing/TitleController.kt b/api/src/routing/TitleController.kt index af8e476..8c71777 100644 --- a/api/src/routing/TitleController.kt +++ b/api/src/routing/TitleController.kt @@ -34,7 +34,7 @@ fun Routing.title(kodein: Kodein) { val noteUuid = call.parameters.noteUuid() val exists = notesService.noteExists(userId, noteUuid) - if (exists) return@patch call.respondStatus(HttpStatusCode.NotFound) + if (!exists) return@patch call.respondStatus(HttpStatusCode.NotFound) val notePatch = call.receiveNotePatch().copy(uuid = noteUuid) @@ -47,7 +47,7 @@ fun Routing.title(kodein: Kodein) { val noteUuid = call.parameters.noteUuid() val exists = notesService.noteExists(userId, noteUuid) - if (exists) return@delete call.respondStatus(HttpStatusCode.NotFound) + if (!exists) return@delete call.respondStatus(HttpStatusCode.NotFound) notesService.deleteNote(noteUuid) call.respondStatus(HttpStatusCode.OK)