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
}).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

View file

@ -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",

View file

@ -62,7 +62,6 @@ struct HealthForm {
#[post("/health-form")]
pub async fn health_form(MultipartForm(form): MultipartForm<HealthForm>) -> HttpResponse {
log::info!("{:?}", form);
let first = form
.first_name
.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 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<HealthForm>) -> Http
.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)
.multipart(multi)
{

View file

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