my_vote,
})
}
+
+ /// Gets the recipient user id.
+ /// If there is no parent comment, its the post creator
+ pub fn get_recipient_id(&self) -> i32 {
+ match &self.recipient {
+ Some(parent_commenter) => parent_commenter.id,
+ None => self.post.creator_id,
+ }
+ }
}
pub struct CommentQueryBuilder<'a> {
let _inserted_comment_like = CommentLike::like(&conn, &comment_like_form).unwrap();
+ let agg = CommentAggregates::read(&conn, inserted_comment.id).unwrap();
+
let expected_comment_view_no_user = CommentView {
creator_banned_from_community: false,
my_vote: None,
published: inserted_community.published,
},
counts: CommentAggregates {
- id: inserted_comment.id, // TODO
+ id: agg.id,
comment_id: inserted_comment.id,
score: 1,
upvotes: 1,