]> Untitled Git - lemmy.git/blobdiff - crates/api/src/post/mark_read.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / api / src / post / mark_read.rs
index 0e013a88363912dda3997841fe57ed007a5ce25c..0b777a7e1d4e27354bdb1b51400bd98f49d10ba2 100644 (file)
@@ -22,13 +22,13 @@ impl Perform for MarkPostAsRead {
 
     // Mark the post as read / unread
     if data.read {
-      mark_post_as_read(person_id, post_id, context.pool()).await?;
+      mark_post_as_read(person_id, post_id, &mut context.pool()).await?;
     } else {
-      mark_post_as_unread(person_id, post_id, context.pool()).await?;
+      mark_post_as_unread(person_id, post_id, &mut context.pool()).await?;
     }
 
     // Fetch it
-    let post_view = PostView::read(context.pool(), post_id, Some(person_id), None).await?;
+    let post_view = PostView::read(&mut context.pool(), post_id, Some(person_id), None).await?;
 
     Ok(Self::Response { post_view })
   }