]> Untitled Git - lemmy.git/blobdiff - lemmy_db/src/views/post_view.rs
Merge remote-tracking branch 'origin/split-db-workspace' into move_views_to_diesel_split
[lemmy.git] / lemmy_db / src / views / post_view.rs
index 358b46cd8fb497ffa9c382100f0a7c10be5b0963..3cfee1b371300c14ec24e7e19c28a912209b73ac 100644 (file)
@@ -190,7 +190,7 @@ impl<'a> PostQueryBuilder<'a> {
   }
 
   pub fn my_user_id<T: MaybeOptional<i32>>(mut self, my_user_id: T) -> Self {
-    self.community_id = my_user_id.get_optional();
+    self.my_user_id = my_user_id.get_optional();
     self
   }
 
@@ -533,6 +533,8 @@ mod tests {
     let read_post_listing_with_user =
       PostView::read(&conn, inserted_post.id, Some(inserted_user.id)).unwrap();
 
+    let agg = PostAggregates::read(&conn, inserted_post.id).unwrap();
+
     // the non user version
     let expected_post_listing_no_user = PostView {
       post: Post {
@@ -592,7 +594,7 @@ mod tests {
         published: inserted_community.published,
       },
       counts: PostAggregates {
-        id: inserted_post.id, // TODO this might fail
+        id: agg.id,
         post_id: inserted_post.id,
         comments: 0,
         score: 1,