Show removed posts in users history.

- Fixes #354
This commit is contained in:
Dessalines 2019-12-06 22:43:20 -08:00
parent ab53840324
commit 43d32d516b

View file

@ -95,8 +95,15 @@ impl PostView {
let mut query = post_view.into_boxed();
// If its for a specific user, show the removed / deleted
if let Some(for_creator_id) = for_creator_id {
query = query.filter(creator_id.eq(for_creator_id));
} else {
query = query
.filter(removed.eq(false))
.filter(deleted.eq(false))
.filter(community_removed.eq(false))
.filter(community_deleted.eq(false));
};
if let Some(search_term) = search_term {
@ -161,13 +168,7 @@ impl PostView {
.then_order_by(score.desc()),
};
query = query
.limit(limit)
.offset(offset)
.filter(removed.eq(false))
.filter(deleted.eq(false))
.filter(community_removed.eq(false))
.filter(community_deleted.eq(false));
query = query.limit(limit).offset(offset);
query.load::<Self>(conn)
}