Find notes by tags in notes list
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user