},
traits::Crud,
};
-use lemmy_utils::error::LemmyError;
+use lemmy_utils::error::{LemmyError, LemmyErrorExt, LemmyErrorType};
#[async_trait::async_trait(?Send)]
impl Perform for HideCommunity {
};
let community_id = data.community_id;
- Community::update(context.pool(), community_id, &community_form)
+ Community::update(&mut context.pool(), community_id, &community_form)
.await
- .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_community_hidden_status"))?;
+ .with_lemmy_type(LemmyErrorType::CouldntUpdateCommunityHiddenStatus)?;
- ModHideCommunity::create(context.pool(), &mod_hide_community_form).await?;
+ ModHideCommunity::create(&mut context.pool(), &mod_hide_community_form).await?;
build_community_response(context, local_user_view, community_id).await
}