utils::local_user_view_from_jwt,
};
use lemmy_db_views::comment_report_view::CommentReportQuery;
-use lemmy_utils::{error::LemmyError, ConnectionId};
+use lemmy_utils::error::LemmyError;
/// Lists comment reports for a community if an id is supplied
/// or returns all comment reports for communities a user moderates
impl Perform for ListCommentReports {
type Response = ListCommentReportsResponse;
- #[tracing::instrument(skip(context, _websocket_id))]
+ #[tracing::instrument(skip(context))]
async fn perform(
&self,
context: &Data<LemmyContext>,
- _websocket_id: Option<ConnectionId>,
) -> Result<ListCommentReportsResponse, LemmyError> {
let data: &ListCommentReports = self;
let local_user_view = local_user_view_from_jwt(&data.auth, context).await?;
let page = data.page;
let limit = data.limit;
let comment_reports = CommentReportQuery::builder()
- .pool(context.pool())
+ .pool(&mut context.pool())
.my_person_id(person_id)
.admin(admin)
.community_id(community_id)
.list()
.await?;
- let res = ListCommentReportsResponse { comment_reports };
-
- Ok(res)
+ Ok(ListCommentReportsResponse { comment_reports })
}
}