default order & asc/desc changed for tags
This commit is contained in:
parent
674fb60f86
commit
4cede883c5
4
app.moon
4
app.moon
@ -59,11 +59,11 @@ class extends lapis.Application
|
||||
-- validate order
|
||||
@order = tostring(@params.order)\lower!
|
||||
unless Tags.fields[@order]
|
||||
@order = "id"
|
||||
@order = "count"
|
||||
-- validate ascending/descending (ascending default)
|
||||
@asc_desc = tostring(@params.asc_desc)\upper!
|
||||
if @asc_desc != "DESC" and @asc_desc != "ASC"
|
||||
@asc_desc = "ASC"
|
||||
@asc_desc = "DESC"
|
||||
@page = tonumber(@params.page) or 1
|
||||
|
||||
tags = Tags\paginated "* ORDER BY #{escape_identifier @order} #{@asc_desc}", per_page: 32
|
||||
|
Reference in New Issue
Block a user