mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 22:27:08 +00:00
* Dont show deleted / removed posts when searching. Fixes #4576 * Address PR comments. * Clean up comment removed also. --------- Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
This commit is contained in:
parent
b05f221565
commit
5c35e97a75
|
@ -220,8 +220,7 @@ fn queries<'a>() -> Queries<
|
|||
query = query.filter(
|
||||
comment::content
|
||||
.ilike(fuzzy_search(&search_term))
|
||||
.and(comment::removed.eq(false))
|
||||
.and(comment::deleted.eq(false)),
|
||||
.and(not(comment::removed.or(comment::deleted))),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -396,11 +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)),
|
||||
);
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue