]> Untitled Git - lemmy.git/blobdiff - crates/api/src/local_user.rs
Admins can view all reports. Fixes #1810 (#1825)
[lemmy.git] / crates / api / src / local_user.rs
index 1d4f27b28676a8f0eef9c268b16aec7ae210a14b..930be955de83cce4ae7b2770f6730ee07f8d98ee 100644 (file)
@@ -822,15 +822,16 @@ impl Perform for GetReportCount {
       get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
 
     let person_id = local_user_view.person.id;
+    let admin = local_user_view.person.admin;
     let community_id = data.community_id;
 
     let comment_reports = blocking(context.pool(), move |conn| {
-      CommentReportView::get_report_count(conn, person_id, community_id)
+      CommentReportView::get_report_count(conn, person_id, admin, community_id)
     })
     .await??;
 
     let post_reports = blocking(context.pool(), move |conn| {
-      PostReportView::get_report_count(conn, person_id, community_id)
+      PostReportView::get_report_count(conn, person_id, admin, community_id)
     })
     .await??;