]> Untitled Git - lemmy.git/commitdiff
Fix missing local user from post queries. (#2447)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 26 Sep 2022 14:39:22 +0000 (10:39 -0400)
committerGitHub <noreply@github.com>
Mon, 26 Sep 2022 14:39:22 +0000 (10:39 -0400)
crates/api_crud/src/post/list.rs
crates/api_crud/src/user/read.rs

index 9d9b156c617979adfdb18ddc5c3aa8b6e16702ab..e58ff8715b2cdee2e9a5471d194c15aecf042aba 100644 (file)
@@ -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)
index d9d26f0cdd4ef76df0c0f97176ccf86613e1a346..a22bb85e885b513e59ad94f0e1a998ff4d5eefbf 100644 (file)
@@ -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);