diff --git a/Cargo.lock b/Cargo.lock index 2ff8f3d..5ad4fc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1504,6 +1504,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + [[package]] name = "indexmap" version = "1.9.3" @@ -2503,6 +2509,7 @@ dependencies = [ "serde", "sqlx", "uuid", + "validator", "wasm-bindgen", "web-sys", ] @@ -3558,6 +3565,48 @@ dependencies = [ "getrandom", ] +[[package]] +name = "validator" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" +dependencies = [ + "idna", + "lazy_static", + "regex", + "serde", + "serde_derive", + "serde_json", + "url", + "validator_derive", +] + +[[package]] +name = "validator_derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc44ca3088bb3ba384d9aecf40c6a23a676ce23e09bdaca2073d99c207f864af" +dependencies = [ + "if_chain", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "validator_types", +] + +[[package]] +name = "validator_types" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111abfe30072511849c5910134e8baf8dc05de4c0e5903d681cbd5c9c4d611e3" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index 711ce2d..876a4cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ chrono = "0.4.26" sqlx = { version = "0.7.1", optional = true, features = ["runtime-tokio-rustls", "postgres", "chrono", "rust_decimal"] } rust_decimal = "1.31.0" uuid = {version = "1.4.1", features = ["v4"]} +validator = {version = "0.16.1", features = ["derive"]} [features] csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"] diff --git a/src/app.rs b/src/app.rs index 0d37386..fabe319 100644 --- a/src/app.rs +++ b/src/app.rs @@ -3,6 +3,7 @@ use leptos_meta::*; use leptos_router::*; use crate::locales::trl; use crate::pages::home_page::HomePage; +use crate::pages::settings::Settings; #[component] pub fn App(cx: Scope) -> impl IntoView { @@ -98,21 +99,15 @@ pub fn App(cx: Scope) -> impl IntoView {