]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/email_verification.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / db_schema / src / impls / email_verification.rs
index af19bbba0d1e4c306b2e5080c2e2f86f4626ce0a..59c5b9536aed27d1d25fe7526eb794d3825917a3 100644 (file)
@@ -19,7 +19,7 @@ use diesel::{
 use diesel_async::RunQueryDsl;
 
 impl EmailVerification {
-  pub async fn create(pool: &DbPool, form: &EmailVerificationForm) -> Result<Self, Error> {
+  pub async fn create(pool: &mut DbPool<'_>, form: &EmailVerificationForm) -> Result<Self, Error> {
     let conn = &mut get_conn(pool).await?;
     insert_into(email_verification)
       .values(form)
@@ -27,7 +27,7 @@ impl EmailVerification {
       .await
   }
 
-  pub async fn read_for_token(pool: &DbPool, token: &str) -> Result<Self, Error> {
+  pub async fn read_for_token(pool: &mut DbPool<'_>, token: &str) -> Result<Self, Error> {
     let conn = &mut get_conn(pool).await?;
     email_verification
       .filter(verification_token.eq(token))
@@ -36,7 +36,7 @@ impl EmailVerification {
       .await
   }
   pub async fn delete_old_tokens_for_local_user(
-    pool: &DbPool,
+    pool: &mut DbPool<'_>,
     local_user_id_: LocalUserId,
   ) -> Result<usize, Error> {
     let conn = &mut get_conn(pool).await?;