- Some(is_mod_or_admin),
- )
- .await
- .with_lemmy_type(LemmyErrorType::CouldntFindCommunity)?;
-
- // 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
- .with_lemmy_type(LemmyErrorType::CouldntFindPost)?;
- }
+ post_id,
+ read_comments,
+ ..PersonPostAggregatesForm::default()
+ };
+ PersonPostAggregates::upsert(&mut context.pool(), &person_post_agg_form)
+ .await
+ .with_lemmy_type(LemmyErrorType::CouldntFindPost)?;
+ }