Persistance: Note can now be put in the trash
This commit is contained in:
@@ -55,10 +55,10 @@ class NoteController(
|
||||
val noteUuid = request.uuidPath() ?: return Response(NOT_FOUND)
|
||||
|
||||
if (request.method == Method.POST && request.form("delete") != null) {
|
||||
return if (noteService.delete(jwtPayload.userId, noteUuid))
|
||||
Response.redirect("/notes") // FIXME: flash cookie to show success ?
|
||||
return if (noteService.trash(jwtPayload.userId, noteUuid))
|
||||
Response.redirect("/notes") // TODO: flash cookie to show success ?
|
||||
else
|
||||
Response(NOT_FOUND) // FIXME: show an error
|
||||
Response(NOT_FOUND) // TODO: show an error
|
||||
}
|
||||
|
||||
val note = noteService.find(jwtPayload.userId, noteUuid) ?: return Response(NOT_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user