]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/private_message_report.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / db_schema / src / impls / private_message_report.rs
index 5f2498c283f6da923a6cc4fc97a0a520fccb07e9..ca218796005ba880dc56be12b25d61f2f53edce6 100644 (file)
@@ -18,7 +18,10 @@ impl Reportable for PrivateMessageReport {
   type Form = PrivateMessageReportForm;
   type IdType = PrivateMessageReportId;
 
-  async fn report(pool: &DbPool, pm_report_form: &PrivateMessageReportForm) -> Result<Self, Error> {
+  async fn report(
+    pool: &mut DbPool<'_>,
+    pm_report_form: &PrivateMessageReportForm,
+  ) -> Result<Self, Error> {
     let conn = &mut get_conn(pool).await?;
     insert_into(private_message_report)
       .values(pm_report_form)
@@ -27,7 +30,7 @@ impl Reportable for PrivateMessageReport {
   }
 
   async fn resolve(
-    pool: &DbPool,
+    pool: &mut DbPool<'_>,
     report_id: Self::IdType,
     by_resolver_id: PersonId,
   ) -> Result<usize, Error> {
@@ -43,7 +46,7 @@ impl Reportable for PrivateMessageReport {
   }
 
   async fn unresolve(
-    pool: &DbPool,
+    pool: &mut DbPool<'_>,
     report_id: Self::IdType,
     by_resolver_id: PersonId,
   ) -> Result<usize, Error> {