This commit is contained in:
Tangent 2019-04-17 22:17:56 -07:00
parent 99b81c6da1
commit 8af3343aa2
2 changed files with 2 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import Tracks from require "models"
class extends lapis.Application class extends lapis.Application
"/console": console.make! "/console": console.make!
-- TODO figure out why [%u] character class does not work
[tracks: "/tracks(/:order[%a])(/:asc_desc)(/:page[%d])"]: => [tracks: "/tracks(/:order[%a])(/:asc_desc)(/:page[%d])"]: =>
@order = tostring(@params.order)\lower! @order = tostring(@params.order)\lower!
-- validate order field -- validate order field
@ -19,8 +20,6 @@ class extends lapis.Application
tracks = Tracks\paginated "* ORDER BY #{@order} #{@asc_desc}", per_page: 32 tracks = Tracks\paginated "* ORDER BY #{@order} #{@asc_desc}", per_page: 32
-- @last_page = tracks\num_pages! -- TODO figure out why this errors -- @last_page = tracks\num_pages! -- TODO figure out why this errors
@last_page = 150 @last_page = 150
-- if true
-- return "success this far"
-- validate page -- validate page
if @page < 1 if @page < 1
return redirect_to: @url_for "tracks", order: @order, asc_desc: @asc_desc, page: 1 return redirect_to: @url_for "tracks", order: @order, asc_desc: @asc_desc, page: 1