mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 22:49:18 +00:00
parent
a1beccf353
commit
1ef095dd96
|
@ -91,12 +91,16 @@ impl PerformCrud for GetPost {
|
||||||
|
|
||||||
// Fetch the cross_posts
|
// Fetch the cross_posts
|
||||||
let cross_posts = if let Some(url) = &post_view.post.url {
|
let cross_posts = if let Some(url) = &post_view.post.url {
|
||||||
PostQuery::builder()
|
let mut x_posts = PostQuery::builder()
|
||||||
.pool(context.pool())
|
.pool(context.pool())
|
||||||
.url_search(Some(url.inner().as_str().into()))
|
.url_search(Some(url.inner().as_str().into()))
|
||||||
.build()
|
.build()
|
||||||
.list()
|
.list()
|
||||||
.await?
|
.await?;
|
||||||
|
|
||||||
|
// Don't return this post as one of the cross_posts
|
||||||
|
x_posts.retain(|x| x.post.id != post_id);
|
||||||
|
x_posts
|
||||||
} else {
|
} else {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue