bug in health form

This commit is contained in:
Chris Cochrun 2024-01-10 10:41:40 -06:00
parent 9e5acd6aa5
commit 64917db638
4 changed files with 14 additions and 16 deletions

View file

@ -84,16 +84,16 @@
body: data body: data
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
/* if (res.ok) { if (res.ok) {
* if (mtRegistration === 'now') if (mtRegistration === 'now')
* window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13DM3'; window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13DM3';
* else if (registration === 'now') else if (registration === 'now')
* window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ'; window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ';
* else if (registration === 'full') else if (registration === 'full')
* window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE'; window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE';
* else else
* window.location.href = '/thankyou/'; window.location.href = '/thankyou/';
* } */ }
}); });
// For use in prod // For use in prod

View file

@ -12,8 +12,8 @@
const age = calculate_age(birthdate); const age = calculate_age(birthdate);
data.append("age", age); data.append("age", age);
/* let base = "https://api.tfcconnection.org/local-trip-form"; */ let base = "https://api.tfcconnection.org/local-trip-form";
let base = "http://localhost:4242/mt-form"; /* let base = "http://localhost:4242/mt-form"; */
fetch(base, { fetch(base, {
method: "POST", method: "POST",

View file

@ -62,7 +62,6 @@ struct HealthForm {
#[post("/health-form")] #[post("/health-form")]
pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> HttpResponse { pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> HttpResponse {
log::info!("{:?}", form);
let first = form let first = form
.first_name .first_name
.as_ref() .as_ref()
@ -432,7 +431,6 @@ pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> Http
let mut path: Option<String> = Some(String::from("")); let mut path: Option<String> = Some(String::from(""));
let mut file_exists = false; let mut file_exists = false;
let mut filename = String::from(""); let mut filename = String::from("");
log::info!("{:?}", form);
log::info!("{:?}", file_exists); log::info!("{:?}", file_exists);
if let Some(f) = form.file { if let Some(f) = form.file {
if let Some(file) = f.file_name { if let Some(file) = f.file_name {
@ -474,7 +472,7 @@ pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> Http
.unwrap(), .unwrap(),
) )
.to("Chris Cochrun <chris@tfcconnection.org>".parse().unwrap()) .to("Chris Cochrun <chris@tfcconnection.org>".parse().unwrap())
// .to("Ethan Rose <ethan@tfcconnection.org>".parse().unwrap()) .to("Ethan Rose <ethan@tfcconnection.org>".parse().unwrap())
.subject(email_subject) .subject(email_subject)
.multipart(multi) .multipart(multi)
{ {

View file

@ -221,7 +221,7 @@ pub async fn local_form(MultipartForm(form): MultipartForm<LocalForm>) -> HttpRe
} }
} }
body { body {
h1 { @format!("Mission trip form for {} {}!", first, last) } h1 { @format!("Local mission trip form for {} {}!", first, last) }
hr; hr;
table { table {
tr { tr {