From 7c2c27f442d0c4ccd72423279897e97ce50f34ca Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 29 Apr 2024 12:27:03 -0400 Subject: [PATCH] Address PR comments. --- crates/db_views/src/post_view.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index 5abfa29a2..4c7ecd088 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -396,13 +396,13 @@ fn queries<'a>() -> Queries< if let Some(search_term) = &options.search_term { let searcher = fuzzy_search(search_term); - query = query.filter( - (post::name - .ilike(searcher.clone()) - .or(post::body.ilike(searcher))) - .and(post::removed.eq(false)) - .and(post::deleted.eq(false)), - ); + query = query + .filter( + post::name + .ilike(searcher.clone()) + .or(post::body.ilike(searcher)), + ) + .filter(not(post::removed.or(post::deleted))); } // If there is a content warning, show nsfw content by default.