From 49ca4da76305a2e15c92ba809ef9b7a7a20f1563 Mon Sep 17 00:00:00 2001 From: dullbananas Date: Wed, 20 Dec 2023 16:01:18 -0700 Subject: [PATCH] Update post_view.rs --- crates/db_views/src/post_view.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index f382f3920..edeb4ba44 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -1446,7 +1446,7 @@ mod tests { let inserted_community = Community::create(pool, &community_form).await.unwrap(); let mut inserted_post_ids = vec![]; - let mut comment_forms = vec![]; + let mut inserted_comment_ids = vec![]; // Create 150 posts with varying non-correlating values for publish date, number of comments, and featured for comments in 0..10 { @@ -1468,13 +1468,12 @@ mod tests { .post_id(inserted_post.id) .content("yes".to_owned()) .build(); - comment_forms.push((comment_form, None)); + let inserted_comment = Comment::create(pool, &comment_form, None).await.unwrap(); + inserted_comment_ids.push(inserted_comment.id); } } } - Comment::create_batch(pool, &comment_forms).await.unwrap(); - let mut listed_post_ids = vec![]; let mut page_after = None; loop {