diff --git a/api/src/lib.rs b/api/src/lib.rs index edd5814..b695ac0 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -43,12 +43,12 @@ pub fn rocket() -> Rocket{ routes::candidate::logout, routes::candidate::whoami, routes::candidate::get_details, + routes::candidate::post_details, ], ) .mount( "/candidate/add", routes![ - routes::candidate::add_details, routes::candidate::upload_portfolio_letter, routes::candidate::upload_portfolio_zip, routes::candidate::upload_cover_letter, diff --git a/api/src/routes/candidate.rs b/api/src/routes/candidate.rs index e034f85..2bb1233 100644 --- a/api/src/routes/candidate.rs +++ b/api/src/routes/candidate.rs @@ -77,8 +77,9 @@ pub async fn whoami(session: CandidateAuth) -> Result> { Ok(candidate.application.to_string()) } +// TODO: use put instead of post??? #[post("/details", data = "
")] -pub async fn add_details( +pub async fn post_details( conn: Connection<'_, Db>, details: Json, session: CandidateAuth, @@ -397,7 +398,7 @@ mod tests { let details_orig: ApplicationDetails = serde_json::from_str(CANDIDATE_DETAILS).unwrap(); let response = client - .post("/candidate/add/details") + .post("/candidate/details") .cookie(cookies.0.clone()) .cookie(cookies.1.clone()) .body(CANDIDATE_DETAILS.to_string()) @@ -427,7 +428,7 @@ mod tests { let key = Cookie::new("key", private_key); let response = client - .post("/candidate/add/details") + .post("/candidate/details") .cookie(id.clone()) .cookie(key.clone()) .body(CANDIDATE_DETAILS.to_string()) @@ -455,7 +456,7 @@ mod tests { let cookies = admin_login(&client); let response = client - .post("/candidate/add/details") + .post("/candidate/details") .cookie(cookies.0.clone()) .cookie(cookies.1.clone()) .body(CANDIDATE_DETAILS.to_string())