]> Untitled Git - lemmy.git/blobdiff - crates/api/src/comment/save.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / api / src / comment / save.rs
index 42c91bf05fbf6e336b5adf40d16d9dc5948b9b82..7161c8e9cdea8c3bca9f34653a62017a15e104a7 100644 (file)
@@ -27,18 +27,18 @@ impl Perform for SaveComment {
     };
 
     if data.save {
-      CommentSaved::save(context.pool(), &comment_saved_form)
+      CommentSaved::save(&mut context.pool(), &comment_saved_form)
         .await
         .with_lemmy_type(LemmyErrorType::CouldntSaveComment)?;
     } else {
-      CommentSaved::unsave(context.pool(), &comment_saved_form)
+      CommentSaved::unsave(&mut context.pool(), &comment_saved_form)
         .await
         .with_lemmy_type(LemmyErrorType::CouldntSaveComment)?;
     }
 
     let comment_id = data.comment_id;
     let person_id = local_user_view.person.id;
-    let comment_view = CommentView::read(context.pool(), comment_id, Some(person_id)).await?;
+    let comment_view = CommentView::read(&mut context.pool(), comment_id, Some(person_id)).await?;
 
     Ok(CommentResponse {
       comment_view,