]> Untitled Git - lemmy.git/blobdiff - crates/api_crud/src/comment/delete.rs
Moving settings and secrets to context.
[lemmy.git] / crates / api_crud / src / comment / delete.rs
index 85917846e40f6c3192979c9e4eb6631135a6eb41..0b44f4ebbd5e268bb91b5802cfc1860c2a5629d9 100644 (file)
@@ -25,7 +25,8 @@ impl PerformCrud for DeleteComment {
     websocket_id: Option<ConnectionId>,
   ) -> Result<CommentResponse, LemmyError> {
     let data: &DeleteComment = self;
-    let local_user_view = get_local_user_view_from_jwt(&data.auth, context.pool()).await?;
+    let local_user_view =
+      get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
 
     let comment_id = data.comment_id;
     let orig_comment = blocking(context.pool(), move |conn| {
@@ -76,6 +77,7 @@ impl PerformCrud for DeleteComment {
       post,
       context.pool(),
       false,
+      &context.settings(),
     )
     .await?;
 
@@ -102,7 +104,8 @@ impl PerformCrud for RemoveComment {
     websocket_id: Option<ConnectionId>,
   ) -> Result<CommentResponse, LemmyError> {
     let data: &RemoveComment = self;
-    let local_user_view = get_local_user_view_from_jwt(&data.auth, context.pool()).await?;
+    let local_user_view =
+      get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
 
     let comment_id = data.comment_id;
     let orig_comment = blocking(context.pool(), move |conn| {
@@ -169,6 +172,7 @@ impl PerformCrud for RemoveComment {
       post,
       context.pool(),
       false,
+      &context.settings(),
     )
     .await?;