Find notes by tags in notes list

This commit is contained in:
2020-08-17 17:09:48 +02:00
parent 8021814c31
commit 5295e32d86
5 changed files with 28 additions and 13 deletions
@@ -46,8 +46,9 @@ class NoteController(
fun list(request: Request, jwtPayload: JwtPayload): Response {
val currentPage = request.query("page")?.toIntOrNull()?.let(::abs) ?: 1
val (pages, notes) = noteService.paginatedNotes(jwtPayload.userId, currentPage)
return Response(OK).html(view.notes(jwtPayload, notes, currentPage, pages))
val tag = request.query("tag")
val (pages, notes) = noteService.paginatedNotes(jwtPayload.userId, currentPage, tag = tag)
return Response(OK).html(view.notes(jwtPayload, notes, currentPage, pages, tag = tag))
}
fun note(request: Request, jwtPayload: JwtPayload): Response {