feat: add confirmation

This commit is contained in:
Sandro Eiler 2024-03-09 14:06:47 +01:00
parent 1bc7ae4c7a
commit 7eebcb12a2
7 changed files with 65 additions and 6 deletions

View file

@ -100,15 +100,13 @@ pub async fn insert_subscriber(
let _ = sqlx::query!(
r#"
INSERT INTO subscriptions (id, email, name, subscribed_at, status)
VALUES ($1, $2, $3, $4, 'confirmed')
VALUES ($1, $2, $3, $4, 'pending_confirmation')
"#,
Uuid::new_v4(),
new_subscriber.email.as_ref(),
new_subscriber.name.as_ref(),
Utc::now()
)
// We use `get_ref` to get an immutable reference to the `PgConnection`
// wrapped by `web::Data`.
.execute(db_pool)
.await
.map_err(|e| {