basic camp form system
This commit is contained in:
parent
432436c0c1
commit
dc15b66627
|
@ -8,32 +8,27 @@ showTitle: false
|
||||||
|
|
||||||
Teens For Christ Connection (TFC) is a rural ministry reaching out to the mission field of teenagers in rural communities across Northwest Kansas and Southwest Nebraska. In rural communities where youth ministry programs and resources are limited, TFC desires to partner with churches to meet this need. Whether this is through providing community youth groups, coaching those already working with youth, or supplying resources and extra curricular activities for area ministries, TFC desires to connect teens with the truth of Jesus Christ and equip them to live out the Great Commission.
|
Teens For Christ Connection (TFC) is a rural ministry reaching out to the mission field of teenagers in rural communities across Northwest Kansas and Southwest Nebraska. In rural communities where youth ministry programs and resources are limited, TFC desires to partner with churches to meet this need. Whether this is through providing community youth groups, coaching those already working with youth, or supplying resources and extra curricular activities for area ministries, TFC desires to connect teens with the truth of Jesus Christ and equip them to live out the Great Commission.
|
||||||
|
|
||||||
<!-- <div class="flex flex-wrap items-center"> -->
|
<div class="flex flex-wrap items-center">
|
||||||
<!-- <span class="basis-full md:basis-3/4 items-center"> -->
|
<span class="basis-full md:basis-3/4 items-center">
|
||||||
<!-- {{< typeit tag=h2 lifeLike=true >}} -->
|
{{< typeit tag=h2 lifeLike=true >}}
|
||||||
<!-- Time to fill out your mission trip application! -->
|
Camp registration is now open!!
|
||||||
<!-- {{< /typeit >}} -->
|
{{< /typeit >}}
|
||||||
<!-- </span> -->
|
</span>
|
||||||
|
|
||||||
<!-- <span class="grow"> -->
|
<span class="grow">
|
||||||
|
|
||||||
<!-- <span class="basis-full md:basis-1/4 items-center mt-6"> -->
|
<span class="basis-full md:basis-1/4 items-center mt-6">
|
||||||
<!-- {{< button href="/mt-form" >}} -->
|
{{< button href="/camp-form" >}}
|
||||||
<!-- Fill out now! -->
|
Fill out now!
|
||||||
<!-- {{< /button >}} -->
|
{{< /button >}}
|
||||||
<!-- </span> -->
|
</span>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
|
|
||||||
<!-- {{< spacing height=h-4 >}} -->
|
{{< spacing height=h-4 >}}
|
||||||
|
|
||||||
> If you need to fill out a health form, please do so [here](/health-form).
|
> If you need to fill out a camp health form, please do so [here](/camp-health-form).
|
||||||
>
|
|
||||||
> Please also fill out the:
|
|
||||||
> - [parent reference form](/mt-parent-form)
|
|
||||||
> - [teacher reference form](/mt-teacher-form)
|
|
||||||
> - [church reference form](/mt-church-form)
|
|
||||||
|
|
||||||
{{< pt src="https://videos.tfcconnection.org/videos/embed/c92fc5dd-ebfd-4d13-b486-d08d281868f2" >}}
|
{{< pt src="https://videos.tfcconnection.org/videos/embed/757dc0dd-9bdc-4d79-8f81-754249ff23d2" >}}
|
||||||
|
|
||||||
## Our Vision
|
## Our Vision
|
||||||
Our vision is to change the world from the heart of America by providing disciple making opportunities that serve communities where student ministries are limited.
|
Our vision is to change the world from the heart of America by providing disciple making opportunities that serve communities where student ministries are limited.
|
||||||
|
|
|
@ -6,29 +6,29 @@ sharingLinks: false
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
We are currently working on updating the form!! Check back soon to get signed up for camp!!
|
<!-- We are currently working on updating the form!! Check back soon to get signed up for camp!! -->
|
||||||
|
|
||||||
<!-- {{< floating-button icon="chevron-down" text="To the form!" link="#form" >}} -->
|
{{< floating-button icon="chevron-down" text="To the form!" link="#form" >}}
|
||||||
<!-- {{< pt src="https://videos.tfcconnection.org/videos/embed/30c22854-51ab-4c10-a5a2-034b0e506abf" width="700" height="576">}} -->
|
{{< pt src="https://videos.tfcconnection.org/videos/embed/757dc0dd-9bdc-4d79-8f81-754249ff23d2" width="700" height="576">}}
|
||||||
|
|
||||||
<!-- We hope you are as excited about camp as we are! If there is anything we can do to answer your questions and help you to get signed up for camp, please let us know! You can email any of us by going to the [contact page](/contact). -->
|
We hope you are as excited about camp as we are! If there is anything we can do to answer your questions and help you to get signed up for camp, please let us know! You can email any of us by going to the [contact page](/contact).
|
||||||
|
|
||||||
<!-- ## Dates -->
|
## Dates
|
||||||
<!-- - Week 1 - July 17 - July 21 -->
|
- Week 1 - July 22 - July 26
|
||||||
<!-- - ~~Week 2 - July 24 - July 28~~ **Week 2 is full for now**, if you'd still like to go, you can ask your TFC leader and possibly be put on a waiting list. -->
|
- Week 2 - July 29 - Aug 2
|
||||||
|
|
||||||
<!-- ## Cost -->
|
## Cost
|
||||||
<!-- We have an early bird registration, so if you register by certain dates, you'll save some money! -->
|
We have an early bird registration, so if you register by certain dates, you'll save some money!
|
||||||
<!-- - By May 3: $65 with registration plus $100 due at camp and a free t shirt! -->
|
- By May 8: $65 with registration plus $100 due at camp and a free t shirt!
|
||||||
<!-- - By June 23: $85 with registration plus $100 due at camp and a free t shirt! -->
|
- By June 28: $85 with registration plus $100 due at camp and a free t shirt!
|
||||||
<!-- - After June 23: $85 with registration plus $100 due at camp... _NO FREE T SHIRT!!!_ -->
|
- After June 28: $85 with registration plus $100 due at camp... _NO FREE T SHIRT!!!_
|
||||||
|
|
||||||
<!-- ## Location -->
|
## Location
|
||||||
<!-- Camp Joy in Republican City, NE -->
|
Camp Joy in Republican City, NE
|
||||||
|
|
||||||
<!-- [70790 Corp Rd 23, Republican City, NE 68971](https://maps.google.com/maps?z=16&q=70790%2Bcorp%2Brd%2B23%2Brepublican%2Bcity%2C%2Bne%2B68971) -->
|
[70790 Corp Rd 23, Republican City, NE 68971](https://maps.google.com/maps?z=16&q=70790%2Bcorp%2Brd%2B23%2Brepublican%2Bcity%2C%2Bne%2B68971)
|
||||||
<!-- <\!-- http://umap.openstreetmap.fr/en/map/anonymous-edit/888075:134YBQNTmQ2pkJ76ur0PJ8KPuAc -\-> -->
|
<!-- http://umap.openstreetmap.fr/en/map/anonymous-edit/888075:134YBQNTmQ2pkJ76ur0PJ8KPuAc -->
|
||||||
|
|
||||||
<!-- {{< map mapName="campmap_888075" >}} -->
|
{{< map mapName="campmap_888075" >}}
|
||||||
|
|
||||||
<!-- {{< camp-form >}} -->
|
{{< camp-form >}}
|
||||||
|
|
2
justfile
2
justfile
|
@ -6,6 +6,8 @@ server:
|
||||||
hugo server --noHTTPCache --disableFastRender
|
hugo server --noHTTPCache --disableFastRender
|
||||||
dev:
|
dev:
|
||||||
NODE_ENV=development ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit -w
|
NODE_ENV=development ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit -w
|
||||||
|
api:
|
||||||
|
cargo build
|
||||||
clean:
|
clean:
|
||||||
cargo clean
|
cargo clean
|
||||||
rm -rf bld/
|
rm -rf bld/
|
||||||
|
|
|
@ -23,13 +23,17 @@
|
||||||
document.getElementById('warning-email').style.margin = '0';
|
document.getElementById('warning-email').style.margin = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
let base = "http://localhost:4242/camp-form";
|
||||||
xhr.onreadystatechange = function() {
|
/* let base = "https://api.tfcconnection.org/camp-form"; */
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
|
||||||
|
fetch(base, {
|
||||||
|
method: "POST",
|
||||||
|
body: data
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.ok) {
|
||||||
let payment = data.get('registration');
|
let payment = data.get('registration');
|
||||||
console.log(payment);
|
|
||||||
let health = data.get('health');
|
let health = data.get('health');
|
||||||
console.log(health);
|
|
||||||
if (health === 'later') {
|
if (health === 'later') {
|
||||||
if (payment === 'now')
|
if (payment === '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';
|
||||||
|
@ -39,20 +43,10 @@
|
||||||
window.location.href = '/thankyou/';
|
window.location.href = '/thankyou/';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (payment === 'later')
|
window.location.href = '/camp-health-form?registration=' + payment;
|
||||||
window.location.href = '/thankyou/';
|
|
||||||
else
|
|
||||||
window.location.href = '/camp-health-form?registration=' + payment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
/* xhr.open("POST", "https://n8n.tfcconnection.org/webhook/mt-application"); */
|
|
||||||
xhr.open("POST", "https://api.tfcconnection.org/camp-form");
|
|
||||||
xhr.send(data);
|
|
||||||
console.log(data);
|
|
||||||
console.log("Hallo!");
|
|
||||||
/* return false; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculate_age(dob) {
|
function calculate_age(dob) {
|
||||||
|
@ -168,8 +162,8 @@
|
||||||
|
|
||||||
<label for="week" class="basis-full">My Camp Plan <span class='inline-block text-[#f39] text-sm align-sub'>* required</span></label>
|
<label for="week" class="basis-full">My Camp Plan <span class='inline-block text-[#f39] text-sm align-sub'>* required</span></label>
|
||||||
<select id="week" name="week" class="flex-auto form-select {{ $formClasses }}">
|
<select id="week" name="week" class="flex-auto form-select {{ $formClasses }}">
|
||||||
<option value="week1">Week 1: July 17-21</option>
|
<option value="week1">Week 1: July 22-26</option>
|
||||||
<!-- <option value="week2">Week 2: July 24-28</option> -->
|
<option value="week2">Week 2: July 29-Aug 2</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<label for="shirt" class="basis-full">T-Shirt Size <span class='inline-block text-[#f39] text-sm'>all t-shirts are in adult sizes only</span></label>
|
<label for="shirt" class="basis-full">T-Shirt Size <span class='inline-block text-[#f39] text-sm'>all t-shirts are in adult sizes only</span></label>
|
||||||
|
@ -218,7 +212,7 @@
|
||||||
<input type="radio" value="now" id="registration" name="registration"
|
<input type="radio" value="now" id="registration" name="registration"
|
||||||
class="form-input {{ $formClasses }}" checked>
|
class="form-input {{ $formClasses }}" checked>
|
||||||
<label for="registration" class="">
|
<label for="registration" class="">
|
||||||
Now - $85
|
Now - $65
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="basis-full">
|
<div class="basis-full">
|
||||||
|
@ -232,7 +226,7 @@
|
||||||
<input type="radio" value="later" id="registration" name="registration"
|
<input type="radio" value="later" id="registration" name="registration"
|
||||||
class="form-input {{ $formClasses }}">
|
class="form-input {{ $formClasses }}">
|
||||||
<label for="registration" class="">
|
<label for="registration" class="">
|
||||||
Later - Send $85 or $185 to the TFC Office
|
Later - Send $65 or $165 to the TFC Office
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="basis-full mt-8">
|
<div class="basis-full mt-8">
|
||||||
|
|
286
src/api/camp_form.rs
Normal file
286
src/api/camp_form.rs
Normal file
|
@ -0,0 +1,286 @@
|
||||||
|
use std::fs;
|
||||||
|
|
||||||
|
use actix_multipart::form::{tempfile::TempFile, text::Text, MultipartForm};
|
||||||
|
use actix_web::{post, HttpResponse};
|
||||||
|
use lettre::{
|
||||||
|
message::{header::ContentType, Attachment, MultiPart, SinglePart},
|
||||||
|
transport::smtp::authentication::{Credentials, Mechanism},
|
||||||
|
Message, SmtpTransport, Transport,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(Debug, MultipartForm, Default)]
|
||||||
|
struct CampForm {
|
||||||
|
#[multipart(rename = "firstname")]
|
||||||
|
first_name: Option<Text<String>>,
|
||||||
|
#[multipart(rename = "lastname")]
|
||||||
|
last_name: Option<Text<String>>,
|
||||||
|
#[multipart(rename = "parentfirstname")]
|
||||||
|
parent_first_name: Option<Text<String>>,
|
||||||
|
#[multipart(rename = "parentlastname")]
|
||||||
|
parent_last_name: Option<Text<String>>,
|
||||||
|
birthdate: Option<Text<String>>,
|
||||||
|
gender: Option<Text<String>>,
|
||||||
|
street: Option<Text<String>>,
|
||||||
|
city: Option<Text<String>>,
|
||||||
|
state: Option<Text<String>>,
|
||||||
|
zip: Option<Text<i32>>,
|
||||||
|
parentphone: Option<Text<String>>,
|
||||||
|
parentemail: Option<Text<String>>,
|
||||||
|
grade: Option<Text<String>>,
|
||||||
|
shirt: Option<Text<String>>,
|
||||||
|
allergies: Option<Text<String>>,
|
||||||
|
week: Option<Text<String>>,
|
||||||
|
registration: Option<Text<String>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[post("/camp-form")]
|
||||||
|
pub async fn camp_form(MultipartForm(form): MultipartForm<CampForm>) -> HttpResponse {
|
||||||
|
let first = form
|
||||||
|
.first_name
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let last = form
|
||||||
|
.last_name
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let email_subject = format!("{} {} signed up for camp!", first, last);
|
||||||
|
let parent = format!(
|
||||||
|
"{} {}",
|
||||||
|
form.parent_first_name
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from("")
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone(),
|
||||||
|
form.parent_last_name
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from("")
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone()
|
||||||
|
);
|
||||||
|
let birthdate = form
|
||||||
|
.birthdate
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let gender = form
|
||||||
|
.gender
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let street = form
|
||||||
|
.street
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let city = form
|
||||||
|
.city
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let state = form
|
||||||
|
.state
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone();
|
||||||
|
let parentphone = form
|
||||||
|
.parentphone
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let parentemail = form
|
||||||
|
.parentemail
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let grade = form
|
||||||
|
.grade
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let shirt = form
|
||||||
|
.shirt
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let allergies = form
|
||||||
|
.allergies
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let week = form
|
||||||
|
.week
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
let registration = form
|
||||||
|
.registration
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Text {
|
||||||
|
0: String::from(""),
|
||||||
|
})
|
||||||
|
.0
|
||||||
|
.clone();
|
||||||
|
log::info!("{first} {last} signed up for camp!");
|
||||||
|
let email = markup::new! {
|
||||||
|
@markup::doctype()
|
||||||
|
html {
|
||||||
|
head {
|
||||||
|
title { @format!("{} {} signed up for camp!", first, last) }
|
||||||
|
style {
|
||||||
|
"table { border-collapse: collapse; width: 100% }"
|
||||||
|
"td, th { padding: 8px }"
|
||||||
|
"td { text-align: left; width: 70%; word-wrap: break-word }"
|
||||||
|
"th { text-align: right; border-right: 1px solid #ddd }"
|
||||||
|
"tr { border-bottom: 1px solid #ddd }"
|
||||||
|
"h1 { text-align: center }"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
h1 { @format!("Mission trip form for {} {}!", first, last) }
|
||||||
|
hr;
|
||||||
|
table {
|
||||||
|
tr {
|
||||||
|
th { "Name" }
|
||||||
|
td { @format!("{} {}", first, last) }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Parent" }
|
||||||
|
td { @parent }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Birthdate" }
|
||||||
|
td { @birthdate }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Gender" }
|
||||||
|
td { @gender }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Street" }
|
||||||
|
td { @street }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "City" }
|
||||||
|
td { @city }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "State" }
|
||||||
|
td { @state }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Zip" }
|
||||||
|
td { @zip }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Parent Phone" }
|
||||||
|
td { @parentphone }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Parent Email" }
|
||||||
|
td { @parentemail }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Grade" }
|
||||||
|
td { @grade }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Camper Allergies" }
|
||||||
|
td { @allergies }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "T-Shirt Size" }
|
||||||
|
td { @shirt }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Week Choice" }
|
||||||
|
td { @week }
|
||||||
|
}
|
||||||
|
tr {
|
||||||
|
th { "Registration" }
|
||||||
|
td { @registration }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let multi = MultiPart::alternative_plain_html(
|
||||||
|
String::from("A camp form was filled out!"),
|
||||||
|
email.to_string(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if let Ok(m) = Message::builder()
|
||||||
|
.from(
|
||||||
|
"TFC ADMIN <no-reply@mail.tfcconnection.org>"
|
||||||
|
.parse()
|
||||||
|
.unwrap(),
|
||||||
|
)
|
||||||
|
.to("Chris Cochrun <chris@tfcconnection.org>".parse().unwrap())
|
||||||
|
// .to("Ethan Rose <ethan@tfcconnection.org>".parse().unwrap())
|
||||||
|
.subject(email_subject)
|
||||||
|
.multipart(multi)
|
||||||
|
{
|
||||||
|
let sender = SmtpTransport::relay("mail.tfcconnection.org")
|
||||||
|
.ok()
|
||||||
|
.unwrap()
|
||||||
|
.credentials(Credentials::new(
|
||||||
|
"no-reply@mail.tfcconnection.org".to_owned(),
|
||||||
|
"r9f36mNZFtiW4f".to_owned(),
|
||||||
|
))
|
||||||
|
.authentication(vec![Mechanism::Plain])
|
||||||
|
.build();
|
||||||
|
match sender.send(&m) {
|
||||||
|
Ok(res) => log::info!("{:?}", res),
|
||||||
|
Err(e) => log::info!("{e}"),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log::info!("Email incorrect");
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpResponse::Ok().body("thankyou")
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
pub mod camp_form;
|
||||||
pub mod church_form;
|
pub mod church_form;
|
||||||
pub mod health_form;
|
pub mod health_form;
|
||||||
pub mod local_trip_form;
|
pub mod local_trip_form;
|
||||||
|
|
22
src/main.rs
22
src/main.rs
|
@ -1,16 +1,14 @@
|
||||||
mod api;
|
mod api;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
use actix_multipart::form::tempfile::TempFileConfig;
|
use actix_multipart::form::tempfile::TempFileConfig;
|
||||||
use actix_web::{middleware, App, HttpServer};
|
use actix_web::{middleware, App, HttpServer};
|
||||||
|
use api::camp_form::camp_form;
|
||||||
use api::church_form::church_form;
|
use api::church_form::church_form;
|
||||||
use api::health_form::health_form;
|
use api::health_form::health_form;
|
||||||
use api::local_trip_form::local_form;
|
use api::local_trip_form::local_form;
|
||||||
use api::mt_form::mt_form;
|
use api::mt_form::mt_form;
|
||||||
use api::parent_form::parent_form;
|
use api::parent_form::parent_form;
|
||||||
use api::teacher_form::teacher_form;
|
use api::teacher_form::teacher_form;
|
||||||
use serde_json::{Number, Value};
|
|
||||||
|
|
||||||
#[actix_web::main]
|
#[actix_web::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
|
@ -21,23 +19,6 @@ async fn main() -> std::io::Result<()> {
|
||||||
|
|
||||||
log::info!("starting HTTP server at http://localhost:4242");
|
log::info!("starting HTTP server at http://localhost:4242");
|
||||||
|
|
||||||
// let mut fields = HashMap::new();
|
|
||||||
// fields.insert("value", Value::String("Frodo".to_string()));
|
|
||||||
// fields.insert("columnId", Value::Number(Number::from(106)));
|
|
||||||
|
|
||||||
// let mut data = HashMap::new();
|
|
||||||
// data.insert("data", vec![fields]);
|
|
||||||
// // let vec = vec![data];
|
|
||||||
// log::info!("{:?}", serde_json::to_string(&data).unwrap());
|
|
||||||
|
|
||||||
// let req = reqwest::Client::new()
|
|
||||||
// .post("https://staff.tfcconnection.org/apps/tables/api/1/tables/9/rows")
|
|
||||||
// .basic_auth("chris", Some("2VHeGxeC^Zf9KqFK^G@Pt!zu2q^6@b"))
|
|
||||||
// .json(&data)
|
|
||||||
// .send()
|
|
||||||
// .await;
|
|
||||||
// log::info!("{:?}", req.unwrap().text().await.unwrap());
|
|
||||||
|
|
||||||
HttpServer::new(|| {
|
HttpServer::new(|| {
|
||||||
App::new()
|
App::new()
|
||||||
.wrap(middleware::Logger::default())
|
.wrap(middleware::Logger::default())
|
||||||
|
@ -48,6 +29,7 @@ async fn main() -> std::io::Result<()> {
|
||||||
.service(teacher_form)
|
.service(teacher_form)
|
||||||
.service(church_form)
|
.service(church_form)
|
||||||
.service(local_form)
|
.service(local_form)
|
||||||
|
.service(camp_form)
|
||||||
})
|
})
|
||||||
.bind(("127.0.0.1", 4242))?
|
.bind(("127.0.0.1", 4242))?
|
||||||
.workers(2)
|
.workers(2)
|
||||||
|
|
Loading…
Reference in a new issue