]> Untitled Git - lemmy.git/blobdiff - lemmy_db/src/views/post_view.rs
Beginning to add new comment_view.
[lemmy.git] / lemmy_db / src / views / post_view.rs
index 4888f9cfbc63f1bbe9d7c9696f5d72d2e5eaf0f1..9791d0a8b508d2450b89c6453b186a26f33f4820 100644 (file)
@@ -33,12 +33,12 @@ pub struct PostView {
   pub post: Post,
   pub creator: UserSafe,
   pub community: CommunitySafe,
-  pub counts: PostAggregates,
-  pub subscribed: bool,                    // Left join to CommunityFollower
   pub creator_banned_from_community: bool, // Left Join to CommunityUserBan
-  pub saved: bool,                         // Left join to PostSaved
-  pub read: bool,                          // Left join to PostRead
-  pub my_vote: Option<i16>,                // Left join to PostLike
+  pub counts: PostAggregates,
+  pub subscribed: bool,     // Left join to CommunityFollower
+  pub saved: bool,          // Left join to PostSaved
+  pub read: bool,           // Left join to PostRead
+  pub my_vote: Option<i16>, // Left join to PostLike
 }
 
 type PostViewTuple = (
@@ -76,7 +76,7 @@ impl PostView {
         community_user_ban::table.on(
           post::community_id
             .eq(community_user_ban::community_id)
-            .and(community_user_ban::user_id.eq(community::creator_id)),
+            .and(community_user_ban::user_id.eq(post::creator_id)),
         ),
       )
       .inner_join(post_aggregates::table)