mirror of https://github.com/LemmyNet/lemmy.git
Creator extra search results
parent
ef7fe7586b
commit
ed31deab00
|
@ -227,8 +227,9 @@ impl Perform for Search {
|
||||||
.await??;
|
.await??;
|
||||||
}
|
}
|
||||||
SearchType::All => {
|
SearchType::All => {
|
||||||
// If the community is included, dont search communities or users
|
// If the community or creator is included, dont search communities or users
|
||||||
let community_included = data.community_id.is_some() || data.community_name.is_some();
|
let community_or_creator_included =
|
||||||
|
data.community_id.is_some() || data.community_name.is_some() || data.creator_id.is_some();
|
||||||
|
|
||||||
posts = blocking(context.pool(), move |conn| {
|
posts = blocking(context.pool(), move |conn| {
|
||||||
PostQueryBuilder::create(conn)
|
PostQueryBuilder::create(conn)
|
||||||
|
@ -268,7 +269,7 @@ impl Perform for Search {
|
||||||
|
|
||||||
let q = data.q.to_owned();
|
let q = data.q.to_owned();
|
||||||
|
|
||||||
communities = if community_included {
|
communities = if community_or_creator_included {
|
||||||
vec![]
|
vec![]
|
||||||
} else {
|
} else {
|
||||||
blocking(context.pool(), move |conn| {
|
blocking(context.pool(), move |conn| {
|
||||||
|
@ -286,7 +287,7 @@ impl Perform for Search {
|
||||||
|
|
||||||
let q = data.q.to_owned();
|
let q = data.q.to_owned();
|
||||||
|
|
||||||
users = if community_included {
|
users = if community_or_creator_included {
|
||||||
vec![]
|
vec![]
|
||||||
} else {
|
} else {
|
||||||
blocking(context.pool(), move |conn| {
|
blocking(context.pool(), move |conn| {
|
||||||
|
|
Loading…
Reference in New Issue