- let report = blocking(context.pool(), move |conn| {
- CommentReport::report(conn, &report_form)
- })
- .await?
- .map_err(|e| LemmyError::from_error_message(e, "couldnt_create_report"))?;
-
- let comment_report_view = blocking(context.pool(), move |conn| {
- CommentReportView::read(conn, report.id, person_id)
- })
- .await??;
-
- let res = CommentReportResponse {
- comment_report_view,
- };
+ let report = CommentReport::report(&mut context.pool(), &report_form)
+ .await
+ .with_lemmy_type(LemmyErrorType::CouldntCreateReport)?;