Fixing trending sorting.

This commit is contained in:
Dessalines 2019-07-03 18:52:17 -07:00
parent ac1f758579
commit 6f6e87fc61
2 changed files with 5 additions and 1 deletions

View File

@ -23,3 +23,5 @@ strum_macros = "0.14.0"
jsonwebtoken = "*"
regex = "*"
lazy_static = "*"
reqwest = "*"
openssl = { version = "0.10", features = ["vendored"] }

View File

@ -125,7 +125,9 @@ impl CommunityView {
// The view lets you pass a null user_id, if you're not logged in
match sort {
SortType::Hot => query = query.order_by(hot_rank.desc()).filter(user_id.is_null()),
SortType::Hot => query = query.order_by(hot_rank.desc())
.then_order_by(published.desc())
.filter(user_id.is_null()),
SortType::New => query = query.order_by(published.desc()).filter(user_id.is_null()),
SortType::TopAll => {
match from_user_id {