mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-15 00:43:59 +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
2 changed files with 8 additions and 7 deletions
|
@ -220,8 +220,7 @@ fn queries<'a>() -> Queries<
|
||||||
query = query.filter(
|
query = query.filter(
|
||||||
comment::content
|
comment::content
|
||||||
.ilike(fuzzy_search(&search_term))
|
.ilike(fuzzy_search(&search_term))
|
||||||
.and(comment::removed.eq(false))
|
.and(not(comment::removed.or(comment::deleted))),
|
||||||
.and(comment::deleted.eq(false)),
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -396,11 +396,13 @@ fn queries<'a>() -> Queries<
|
||||||
|
|
||||||
if let Some(search_term) = &options.search_term {
|
if let Some(search_term) = &options.search_term {
|
||||||
let searcher = fuzzy_search(search_term);
|
let searcher = fuzzy_search(search_term);
|
||||||
query = query.filter(
|
query = query
|
||||||
|
.filter(
|
||||||
post::name
|
post::name
|
||||||
.ilike(searcher.clone())
|
.ilike(searcher.clone())
|
||||||
.or(post::body.ilike(searcher)),
|
.or(post::body.ilike(searcher)),
|
||||||
);
|
)
|
||||||
|
.filter(not(post::removed.or(post::deleted)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is a content warning, show nsfw content by default.
|
// If there is a content warning, show nsfw content by default.
|
||||||
|
|
Loading…
Reference in a new issue