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