- let form = CommentForm {
- creator_id: orig_comment.comment.creator_id,
- post_id: orig_comment.comment.post_id,
- content: content_slurs_removed.unwrap_or(orig_comment.comment.content),
- distinguished: data.distinguished,
- language_id: data.language_id,
- ..Default::default()
- };
- let updated_comment = blocking(context.pool(), move |conn| {
- Comment::update(conn, comment_id, &form)
- })
- .await?
- .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_comment"))?;
+ let form = CommentUpdateForm::builder()
+ .content(content)
+ .language_id(data.language_id)
+ .updated(Some(Some(naive_now())))
+ .build();
+ let updated_comment = Comment::update(&mut context.pool(), comment_id, &form)
+ .await
+ .with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;