/// * `user_id` - the user id of the moderator
/// * `community_id` - optional community id to check for moderator privileges
/// * `pool` - the diesel db pool
-pub(in crate) async fn collect_moderated_communities(
+pub(crate) async fn collect_moderated_communities(
user_id: i32,
community_id: Option<i32>,
pool: &DbPool,
/// returns the current unresolved comment report count for the supplied community ids
///
/// * `community_ids` - a Vec<i32> of community_ids to get a count for
- pub fn get_report_count(conn: &PgConnection, community_ids: &Vec<i32>) -> Result<i64, Error> {
+ pub fn get_report_count(conn: &PgConnection, community_ids: &[i32]) -> Result<i64, Error> {
use super::comment_report::comment_report_view::dsl::*;
comment_report_view
.filter(resolved.eq(false).and(community_id.eq_any(community_ids)))
/// returns the current unresolved post report count for the supplied community ids
///
/// * `community_ids` - a Vec<i32> of community_ids to get a count for
- pub fn get_report_count(conn: &PgConnection, community_ids: &Vec<i32>) -> Result<i64, Error> {
+ pub fn get_report_count(conn: &PgConnection, community_ids: &[i32]) -> Result<i64, Error> {
use super::post_report::post_report_view::dsl::*;
post_report_view
.filter(resolved.eq(false).and(community_id.eq_any(community_ids)))
pub struct ListCommentReports {
pub page: Option<i64>,
pub limit: Option<i64>,
+ /// if no community is given, it returns reports for all communities moderated by the auth user
pub community: Option<i32>,
pub auth: String,
}