* 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
|
||||||
post::name
|
.filter(
|
||||||
.ilike(searcher.clone())
|
post::name
|
||||||
.or(post::body.ilike(searcher)),
|
.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.
|
// If there is a content warning, show nsfw content by default.
|
||||||
|
|
Loading…
Reference in a new issue