pub async fn create_verification(pool: &DBPool, email: String) -> Result<Verify> {
        prune_verifications(pool).await?;

        let exists = verification_exists_for_email(pool, email.clone()).await?;

        if !exists {
            let mut res = generic_service_err!(
                sqlx::query_file_as!(Verify, "sql/verify/create_verification.sql", email.clone())
                .fetch_all(pool).await,
                "Failed to create new verification record");

            Ok(res.remove(0))
        } else {
            let verification = get_verification_for_email(pool, email.clone()).await?;

            Ok(verification)
        }
    }
/// Creates a verification record and returns the resulting record
/// 
/// # Arguments
/// 
/// * `pool` - The database pool
/// * `email` - The email address of the user being verified
Creates a verification record and returns the resulting record
Creates a verification record and returns the resulting record
pub async fn create_verification(pool: &DBPool, email: String) -> Result<Verify> {
        prune_verifications(pool).await?;
        let exists = verification_exists_for_email(pool, email.clone()).await?;
        if !exists {
            let mut res = generic_service_err!(
                sqlx::query_file_as!(Verify, "sql/verify/create_verification.sql", email.clone())
                .fetch_all(pool).await,
                "Failed to create new verification record");
            Ok(res.remove(0))
        } else {
            let verification = get_verification_for_email(pool, email.clone()).await?;
            Ok(verification)
        }
    }
pub async fn create_verification ( pool : & DBPool , email : String ) -> Result < Verify > { prune_verifications ( pool ) . await ? ; let exists = verification_exists_for_email ( pool , email . clone ( ) ) . await ? ; if ! exists { let mut res = generic_service_err ! ( sqlx query_file_as ( Verify " " email clone ( ) ) fetch_all ( pool ) await " " ) ; Ok ( res . remove ( 0 ) ) } else { let verification = get_verification_for_email ( pool , email . clone ( ) ) . await ? ; Ok ( verification ) } }
Creates a verification record and returns the resulting record
Creates a verification record and returns the resulting record
pool
&DBPool
email
String
pool
&DBPool
email
String