Skip to content

Commit

Permalink
Add new subscriber validations from form data
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkirlew committed Apr 3, 2024
1 parent 2e63af7 commit e2e7d51
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 28 deletions.
162 changes: 146 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ tracing-log = "0.2.0"
secrecy = { version = "0.8", features = ["serde"] }
tracing-actix-web = "0.7"
serde-aux = "4"
unicode-segmentation = "1.11.0"
claims = "0.7"
validator = "0.17.0"

# Using table-like toml syntax to avoid a super-long line!
[dependencies.sqlx]
Expand All @@ -35,6 +38,9 @@ features = [

[dev-dependencies]
once_cell = "1"
fake = "~2.3"
quickcheck = "0.9.2"
quickcheck_macros = "0.9.1"

[lib]
path = "src/lib.rs"
Expand Down
8 changes: 8 additions & 0 deletions src/domain/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mod new_subscriber;
mod subscriber_name;
mod subscriber_email;


pub use subscriber_name::SubscriberName;
pub use subscriber_email::SubscriberEmail;
pub use new_subscriber::NewSubscriber;
6 changes: 6 additions & 0 deletions src/domain/new_subscriber.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use crate::domain::{SubscriberEmail, SubscriberName};

pub struct NewSubscriber {
pub email: SubscriberEmail,
pub name: SubscriberName,
}
Loading

0 comments on commit e2e7d51

Please sign in to comment.