moving to using a rust api

This commit is contained in:
Chris Cochrun 2024-01-08 10:51:53 -06:00
parent 2d1424aeb2
commit f00ed3a04c
12 changed files with 1044 additions and 272 deletions

View file

@ -69,8 +69,8 @@
// For use in dev
// Can now start using this in production IF,
// I get the server running on the server
let base = "https://api.tfcconnection.org/health-form";
/* let base = "http://localhost:4242/health-form"; */
/* let base = "https://api.tfcconnection.org/health-form"; */
let base = "http://localhost:4242/health-form";
fetch(base, {
method: "POST",
body: data
@ -141,6 +141,18 @@
document.getElementById('warning-insurance').style.margin = '0';
document.getElementById('warning-policy').style.margin = '0';
document.getElementById('warning-image').style.margin = '0';
// Prefill form based from MT form
document.getElementById('firstname').value = firstName;
document.getElementById('lastname').value = lastName;
document.getElementById('parentfirstname').value = parentFirstName;
document.getElementById('parentlastname').value = parentLastName;
document.getElementById('birthdate').value = birthdate;
document.getElementById('street').value = streetP;
document.getElementById('city').value = cityP;
document.getElementById('state').value = stateP;
document.getElementById('zip').value = zipP;
document.getElementById('cellphone').value = parentPhone;
}
document.addEventListener('DOMContentLoaded', process);
@ -169,16 +181,28 @@
};
document.addEventListener('DOMContentLoaded', dated);
const myUrl = new URL(window.location.toLocaleString());
const mtRegistration = myUrl.searchParams.get('mtregistration');
const registration = myUrl.searchParams.get('registration');
const params = new URL(window.location.toLocaleString()).searchParams;
const mtRegistration = params.get('mtregistration');
const registration = params.get('registration');
const firstName = params.get('firstName');
const lastName = params.get('lastName');
const parentFirstName = params.get('parentFirstName');
const parentLastName = params.get('parentLastName');
const birthdate = params.get('birthdate');
const streetP = params.get('street');
const cityP = params.get('city');
const stateP = params.get('state');
const zipP = params.get('zip');
const parentPhone = params.get('parentPhone');
console.log(mtRegistration);
</script>
<div id="health-form" class="form text-lg w-full">
<form id='form' onsubmit="submitForm(event);" autocomplete="on" method="post" target="_parent" class="w-full items-center flex flex-wrap">
<h3 class="basis-full">2023-2024 Health Form</h3>
<h3 class="basis-full">2024-2025 Health Form</h3>
<div class="basis-full flex flex-wrap my-4">
<label for="firstname" class="basis-full">What is your first and last name?</label>
<br/>