]> Untitled Git - lemmy.git/blobdiff - crates/api/src/community/block.rs
Diesel 2.0.0 upgrade (#2452)
[lemmy.git] / crates / api / src / community / block.rs
index 02ece47f5f3a93e25f668bf9f2cd20b934bde4f1..5f01ac3d7f86a4562e827ed376a21c0c9c9cdb99 100644 (file)
@@ -1,9 +1,8 @@
 use crate::Perform;
 use actix_web::web::Data;
 use lemmy_api_common::{
-  blocking,
   community::{BlockCommunity, BlockCommunityResponse},
-  get_local_user_view_from_jwt,
+  utils::{blocking, get_local_user_view_from_jwt},
 };
 use lemmy_apub::protocol::activities::following::undo_follow::UndoFollowCommunity;
 use lemmy_db_schema::{
@@ -13,8 +12,8 @@ use lemmy_db_schema::{
   },
   traits::{Blockable, Crud, Followable},
 };
-use lemmy_db_views_actor::community_view::CommunityView;
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_db_views_actor::structs::CommunityView;
+use lemmy_utils::{error::LemmyError, ConnectionId};
 use lemmy_websocket::LemmyContext;
 
 #[async_trait::async_trait(?Send)]
@@ -39,7 +38,7 @@ impl Perform for BlockCommunity {
     };
 
     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"))?;
@@ -50,7 +49,7 @@ impl Perform for BlockCommunity {
         person_id,
         pending: false,
       };
-      blocking(context.pool(), move |conn: &'_ _| {
+      blocking(context.pool(), move |conn: &mut _| {
         CommunityFollower::unfollow(conn, &community_follower_form)
       })
       .await?
@@ -61,7 +60,7 @@ impl Perform for BlockCommunity {
       .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"))?;