]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/community_block.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / db_schema / src / impls / community_block.rs
index c1f35e625dc265702fd19d9b87b8049ea0dd9623..9dc21bf2f292e5e608b029e546fedc47a3c87b74 100644 (file)
@@ -10,7 +10,7 @@ use diesel_async::RunQueryDsl;
 #[async_trait]
 impl Blockable for CommunityBlock {
   type Form = CommunityBlockForm;
-  async fn block(pool: &DbPool, community_block_form: &Self::Form) -> Result<Self, Error> {
+  async fn block(pool: &mut DbPool<'_>, community_block_form: &Self::Form) -> Result<Self, Error> {
     let conn = &mut get_conn(pool).await?;
     insert_into(community_block)
       .values(community_block_form)
@@ -20,7 +20,10 @@ impl Blockable for CommunityBlock {
       .get_result::<Self>(conn)
       .await
   }
-  async fn unblock(pool: &DbPool, community_block_form: &Self::Form) -> Result<usize, Error> {
+  async fn unblock(
+    pool: &mut DbPool<'_>,
+    community_block_form: &Self::Form,
+  ) -> Result<usize, Error> {
     let conn = &mut get_conn(pool).await?;
     diesel::delete(
       community_block