From: Dessalines Date: Mon, 26 Sep 2022 14:39:22 +0000 (-0400) Subject: Fix missing local user from post queries. (#2447) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%7B%7D/%22%7Burl%7D/%7BpictrsAvatarThumbnail%28?a=commitdiff_plain;h=9ce15ed07124836b74d58b61f8d494a49c549f6d;p=lemmy.git Fix missing local user from post queries. (#2447) --- diff --git a/crates/api_crud/src/post/list.rs b/crates/api_crud/src/post/list.rs index 9d9b156c..e58ff871 100644 --- a/crates/api_crud/src/post/list.rs +++ b/crates/api_crud/src/post/list.rs @@ -53,6 +53,7 @@ impl PerformCrud for GetPosts { let mut posts = blocking(context.pool(), move |conn| { PostQuery::builder() .conn(conn) + .local_user(local_user_view.map(|l| l.local_user).as_ref()) .listing_type(Some(listing_type)) .sort(sort) .community_id(community_id) diff --git a/crates/api_crud/src/user/read.rs b/crates/api_crud/src/user/read.rs index d9d26f0c..a22bb85e 100644 --- a/crates/api_crud/src/user/read.rs +++ b/crates/api_crud/src/user/read.rs @@ -68,9 +68,9 @@ impl PerformCrud for GetPersonDetails { let posts = blocking(context.pool(), move |conn| { let posts_query = PostQuery::builder() .conn(conn) - .local_user(local_user.as_ref()) .sort(sort) .saved_only(saved_only) + .local_user(local_user.as_ref()) .community_id(community_id) .page(page) .limit(limit);