use actix_web::web::Data;
use anyhow::Context;
use lemmy_api_common::{
- blocking,
community::{GetCommunityResponse, TransferCommunity},
- get_local_user_view_from_jwt,
+ utils::{blocking, get_local_user_view_from_jwt},
};
use lemmy_db_schema::{
source::{
},
traits::{Crud, Joinable},
};
-use lemmy_db_views_actor::{
- community_moderator_view::CommunityModeratorView,
- community_view::CommunityView,
- person_view::PersonViewSafe,
-};
-use lemmy_utils::{location_info, ConnectionId, LemmyError};
+use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView, PersonViewSafe};
+use lemmy_utils::{error::LemmyError, location_info, ConnectionId};
use lemmy_websocket::LemmyContext;
// TODO: we dont do anything for federation here, it should be updated the next time the community
person_id: cmod.moderator.id,
};
- let join = move |conn: &'_ _| CommunityModerator::join(conn, &community_moderator_form);
+ let join = move |conn: &mut _| CommunityModerator::join(conn, &community_moderator_form);
blocking(context.pool(), join)
.await?
.map_err(|e| LemmyError::from_error_message(e, "community_moderator_already_exists"))?;