allow top sorting by boost
This commit is contained in:
parent
83458fdc9e
commit
894d02a196
|
@ -105,6 +105,8 @@ const orderByClause = (by, me, models, type) => {
|
|||
return 'ORDER BY "Item".msats DESC'
|
||||
case 'zaprank':
|
||||
return topOrderByWeightedSats(me, models)
|
||||
case 'boost':
|
||||
return 'ORDER BY "Item".boost DESC'
|
||||
case 'random':
|
||||
return 'ORDER BY RANDOM()'
|
||||
default:
|
||||
|
@ -378,6 +380,7 @@ export default {
|
|||
activeOrMine(me),
|
||||
nsfwClause(showNsfw),
|
||||
typeClause(type),
|
||||
by === 'boost' && '"Item".boost > 0',
|
||||
whenClause(when || 'forever', table))}
|
||||
${orderByClause(by, me, models, type)}
|
||||
OFFSET $4
|
||||
|
@ -421,6 +424,7 @@ export default {
|
|||
typeClause(type),
|
||||
whenClause(when, 'Item'),
|
||||
await filterClause(me, models, type),
|
||||
by === 'boost' && '"Item".boost > 0',
|
||||
muteClause(me))}
|
||||
${orderByClause(by || 'zaprank', me, models, type)}
|
||||
OFFSET $3
|
||||
|
|
|
@ -62,7 +62,7 @@ export const ITEM_FILTER_THRESHOLD = 1.2
|
|||
export const DONT_LIKE_THIS_COST = 1
|
||||
export const COMMENT_TYPE_QUERY = ['comments', 'freebies', 'outlawed', 'borderland', 'all', 'bookmarks']
|
||||
export const USER_SORTS = ['value', 'stacking', 'spending', 'comments', 'posts', 'referrals']
|
||||
export const ITEM_SORTS = ['zaprank', 'comments', 'sats']
|
||||
export const ITEM_SORTS = ['zaprank', 'comments', 'sats', 'boost']
|
||||
export const SUB_SORTS = ['stacking', 'revenue', 'spending', 'posts', 'comments']
|
||||
export const WHENS = ['day', 'week', 'month', 'year', 'forever', 'custom']
|
||||
export const ITEM_TYPES_USER = ['all', 'posts', 'comments', 'bounties', 'links', 'discussions', 'polls', 'freebies', 'jobs', 'bookmarks']
|
||||
|
|
Loading…
Reference in New Issue