Update community_moderator_view.rs

This commit is contained in:
dullbananas 2024-06-21 06:47:10 -07:00 committed by GitHub
parent 37fcfc6138
commit 84142f031c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,7 +88,10 @@ impl CommunityModeratorView {
// A hacky workaround instead of group_bys // A hacky workaround instead of group_bys
// https://stackoverflow.com/questions/24042359/how-to-join-only-one-row-in-joined-table-with-postgres // https://stackoverflow.com/questions/24042359/how-to-join-only-one-row-in-joined-table-with-postgres
.distinct_on(community_moderator::community_id) .distinct_on(community_moderator::community_id)
.order_by(community_moderator::published) .order_by((
community_moderator::community_id,
community_moderator::published,
))
.load::<CommunityModeratorView>(conn) .load::<CommunityModeratorView>(conn)
.await .await
} }