feat: add confirmation
This commit is contained in:
parent
1bc7ae4c7a
commit
7eebcb12a2
7 changed files with 65 additions and 6 deletions
|
|
@ -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| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue