traits::{Blockable, Crud, Followable},
};
use lemmy_db_views_actor::structs::CommunityView;
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_utils::{error::LemmyError, ConnectionId};
use lemmy_websocket::LemmyContext;
#[async_trait::async_trait(?Send)]
};
if data.block {
- let block = move |conn: &'_ _| CommunityBlock::block(conn, &community_block_form);
+ let block = move |conn: &mut _| CommunityBlock::block(conn, &community_block_form);
blocking(context.pool(), block)
.await?
.map_err(|e| LemmyError::from_error_message(e, "community_block_already_exists"))?;
let community_follower_form = CommunityFollowerForm {
community_id: data.community_id,
person_id,
- pending: Some(false),
+ pending: false,
};
- blocking(context.pool(), move |conn: &'_ _| {
+ blocking(context.pool(), move |conn: &mut _| {
CommunityFollower::unfollow(conn, &community_follower_form)
})
.await?
.await??;
UndoFollowCommunity::send(&local_user_view.person.into(), &community.into(), context).await?;
} else {
- let unblock = move |conn: &'_ _| CommunityBlock::unblock(conn, &community_block_form);
+ let unblock = move |conn: &mut _| CommunityBlock::unblock(conn, &community_block_form);
blocking(context.pool(), unblock)
.await?
.map_err(|e| LemmyError::from_error_message(e, "community_block_already_exists"))?;