fixing bug in mt_form
This commit is contained in:
		
							parent
							
								
									2110516859
								
							
						
					
					
						commit
						715a997a1f
					
				
					 1 changed files with 30 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -67,14 +67,40 @@ struct MtForm {
 | 
			
		|||
 | 
			
		||||
#[post("/mt-form")]
 | 
			
		||||
pub async fn mt_form(MultipartForm(form): MultipartForm<MtForm>) -> HttpResponse {
 | 
			
		||||
    let first = form.first_name.as_ref().unwrap().0.clone();
 | 
			
		||||
    let last = form.last_name.as_ref().unwrap().0.clone();
 | 
			
		||||
    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 mission trip!", first, last);
 | 
			
		||||
    let filename_noext = String::from(format!("{}_{}", first, last));
 | 
			
		||||
    let parent = format!(
 | 
			
		||||
        "{} {}",
 | 
			
		||||
        form.parent_first_name.as_ref().unwrap().0.clone(),
 | 
			
		||||
        form.parent_last_name.as_ref().unwrap().0.clone()
 | 
			
		||||
        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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue