From 9ce15ed07124836b74d58b61f8d494a49c549f6d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 26 Sep 2022 10:39:22 -0400 Subject: [PATCH] Fix missing local user from post queries. (#2447) --- crates/api_crud/src/post/list.rs | 1 + crates/api_crud/src/user/read.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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); -- 2.44.1