Fixing admin and mod sort order. Fixes #939 (#941)

This commit is contained in:
Dessalines 2020-07-13 09:42:03 -04:00 committed by GitHub
parent f0357bc988
commit a7c1c472fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -299,6 +299,7 @@ impl CommunityModeratorView {
use super::community_view::community_moderator_view::dsl::*;
community_moderator_view
.filter(community_id.eq(from_community_id))
.order_by(published)
.load::<Self>(conn)
}
@ -306,6 +307,7 @@ impl CommunityModeratorView {
use super::community_view::community_moderator_view::dsl::*;
community_moderator_view
.filter(user_id.eq(from_user_id))
.order_by(published)
.load::<Self>(conn)
}
}

View file

@ -157,7 +157,10 @@ impl UserView {
pub fn admins(conn: &PgConnection) -> Result<Vec<Self>, Error> {
use super::user_view::user_fast::dsl::*;
user_fast.filter(admin.eq(true)).load::<Self>(conn)
user_fast
.filter(admin.eq(true))
.order_by(published)
.load::<Self>(conn)
}
pub fn banned(conn: &PgConnection) -> Result<Vec<Self>, Error> {