parent
ab53840324
commit
43d32d516b
1 changed files with 8 additions and 7 deletions
|
@ -95,8 +95,15 @@ impl PostView {
|
||||||
|
|
||||||
let mut query = post_view.into_boxed();
|
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 {
|
if let Some(for_creator_id) = for_creator_id {
|
||||||
query = query.filter(creator_id.eq(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 {
|
if let Some(search_term) = search_term {
|
||||||
|
@ -161,13 +168,7 @@ impl PostView {
|
||||||
.then_order_by(score.desc()),
|
.then_order_by(score.desc()),
|
||||||
};
|
};
|
||||||
|
|
||||||
query = query
|
query = query.limit(limit).offset(offset);
|
||||||
.limit(limit)
|
|
||||||
.offset(offset)
|
|
||||||
.filter(removed.eq(false))
|
|
||||||
.filter(deleted.eq(false))
|
|
||||||
.filter(community_removed.eq(false))
|
|
||||||
.filter(community_deleted.eq(false));
|
|
||||||
|
|
||||||
query.load::<Self>(conn)
|
query.load::<Self>(conn)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue