]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/custom_emoji/delete.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / api_crud / src / custom_emoji / delete.rs
index dcca883920ace29dac7609cdfcf6a14a39d8c678..06912923971bbd5695ebdbe0b60f6efe415f32bc 100644 (file)
@@ -6,24 +6,23 @@ use lemmy_api_common::{
   utils::{is_admin, local_user_view_from_jwt},
 };
 use lemmy_db_schema::source::custom_emoji::CustomEmoji;
-use lemmy_utils::{error::LemmyError, ConnectionId};
+use lemmy_utils::error::LemmyError;
 
 #[async_trait::async_trait(?Send)]
 impl PerformCrud for DeleteCustomEmoji {
   type Response = DeleteCustomEmojiResponse;
 
-  #[tracing::instrument(skip(self, context, _websocket_id))]
+  #[tracing::instrument(skip(self, context))]
   async fn perform(
     &self,
     context: &Data<LemmyContext>,
-    _websocket_id: Option<ConnectionId>,
   ) -> Result<DeleteCustomEmojiResponse, LemmyError> {
     let data: &DeleteCustomEmoji = self;
     let local_user_view = local_user_view_from_jwt(&data.auth, context).await?;
 
     // Make sure user is an admin
     is_admin(&local_user_view)?;
-    CustomEmoji::delete(context.pool(), data.id).await?;
+    CustomEmoji::delete(&mut context.pool(), data.id).await?;
     Ok(DeleteCustomEmojiResponse {
       id: data.id,
       success: true,