From 64917db638c786451bf8297fa96d75b9bda3bc7b Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 10 Jan 2024 10:41:40 -0600 Subject: [PATCH] bug in health form --- layouts/shortcodes/health-form.html | 20 ++++++++++---------- layouts/shortcodes/local-trip-form.html | 4 ++-- src/api/health_form.rs | 4 +--- src/api/local_trip_form.rs | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/layouts/shortcodes/health-form.html b/layouts/shortcodes/health-form.html index ee21fb0..4cf3125 100644 --- a/layouts/shortcodes/health-form.html +++ b/layouts/shortcodes/health-form.html @@ -84,16 +84,16 @@ body: data }).then((res) => { console.log(res); - /* if (res.ok) { - * if (mtRegistration === 'now') - * window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13DM3'; - * else if (registration === 'now') - * window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ'; - * else if (registration === 'full') - * window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE'; - * else - * window.location.href = '/thankyou/'; - * } */ + if (res.ok) { + if (mtRegistration === 'now') + window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13DM3'; + else if (registration === 'now') + window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ'; + else if (registration === 'full') + window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE'; + else + window.location.href = '/thankyou/'; + } }); // For use in prod diff --git a/layouts/shortcodes/local-trip-form.html b/layouts/shortcodes/local-trip-form.html index 4ac3608..3287c59 100644 --- a/layouts/shortcodes/local-trip-form.html +++ b/layouts/shortcodes/local-trip-form.html @@ -12,8 +12,8 @@ const age = calculate_age(birthdate); data.append("age", age); - /* let base = "https://api.tfcconnection.org/local-trip-form"; */ - let base = "http://localhost:4242/mt-form"; + let base = "https://api.tfcconnection.org/local-trip-form"; + /* let base = "http://localhost:4242/mt-form"; */ fetch(base, { method: "POST", diff --git a/src/api/health_form.rs b/src/api/health_form.rs index d4e0022..f6c13ba 100644 --- a/src/api/health_form.rs +++ b/src/api/health_form.rs @@ -62,7 +62,6 @@ struct HealthForm { #[post("/health-form")] pub async fn health_form(MultipartForm(form): MultipartForm) -> HttpResponse { - log::info!("{:?}", form); let first = form .first_name .as_ref() @@ -432,7 +431,6 @@ pub async fn health_form(MultipartForm(form): MultipartForm) -> Http let mut path: Option = Some(String::from("")); let mut file_exists = false; let mut filename = String::from(""); - log::info!("{:?}", form); log::info!("{:?}", file_exists); if let Some(f) = form.file { if let Some(file) = f.file_name { @@ -474,7 +472,7 @@ pub async fn health_form(MultipartForm(form): MultipartForm) -> Http .unwrap(), ) .to("Chris Cochrun ".parse().unwrap()) - // .to("Ethan Rose ".parse().unwrap()) + .to("Ethan Rose ".parse().unwrap()) .subject(email_subject) .multipart(multi) { diff --git a/src/api/local_trip_form.rs b/src/api/local_trip_form.rs index c24524f..3c2fd22 100644 --- a/src/api/local_trip_form.rs +++ b/src/api/local_trip_form.rs @@ -221,7 +221,7 @@ pub async fn local_form(MultipartForm(form): MultipartForm) -> HttpRe } } body { - h1 { @format!("Mission trip form for {} {}!", first, last) } + h1 { @format!("Local mission trip form for {} {}!", first, last) } hr; table { tr {