From e055ca9b3b100f046323332e797dcb70f36bbc01 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 27 Apr 2024 11:36:01 -0400 Subject: [PATCH] Dont show deleted / removed posts when searching. Fixes #4576 --- crates/db_views/src/post_view.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index 257bcc76c..5abfa29a2 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -397,9 +397,11 @@ fn queries<'a>() -> Queries< if let Some(search_term) = &options.search_term { let searcher = fuzzy_search(search_term); query = query.filter( - post::name + (post::name .ilike(searcher.clone()) - .or(post::body.ilike(searcher)), + .or(post::body.ilike(searcher))) + .and(post::removed.eq(false)) + .and(post::deleted.eq(false)), ); }