- // Insert into PersonPostAggregates
- // to update the read_comments count
- if let Some(person_id) = person_id {
- let read_comments = post_view.counts.comments;
- let person_post_agg_form = PersonPostAggregatesForm {
- person_id,
- post_id,
- read_comments,
- ..PersonPostAggregatesForm::default()
- };
- PersonPostAggregates::upsert(context.pool(), &person_post_agg_form)
- .await
- .map_err(|e| LemmyError::from_error_message(e, "couldnt_find_post"))?;
- }