mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-24 17:11:49 +00:00
refactor: delete deprecated endpoints
This commit is contained in:
parent
64562aa982
commit
b02e191de8
2 changed files with 0 additions and 67 deletions
|
|
@ -90,8 +90,6 @@ pub fn rocket() -> Rocket<Build>{
|
||||||
"/candidate/portfolio",
|
"/candidate/portfolio",
|
||||||
routes![
|
routes![
|
||||||
routes::candidate::submit_portfolio,
|
routes::candidate::submit_portfolio,
|
||||||
routes::candidate::is_portfolio_prepared,
|
|
||||||
routes::candidate::is_portfolio_submitted,
|
|
||||||
routes::candidate::submission_progress,
|
routes::candidate::submission_progress,
|
||||||
routes::candidate::download_portfolio,
|
routes::candidate::download_portfolio,
|
||||||
routes::candidate::delete_portfolio,
|
routes::candidate::delete_portfolio,
|
||||||
|
|
|
||||||
|
|
@ -131,15 +131,6 @@ pub async fn submission_progress(
|
||||||
|
|
||||||
progress
|
progress
|
||||||
}
|
}
|
||||||
// TODO: JSON
|
|
||||||
#[get["/is_cover_letter"]]
|
|
||||||
pub async fn is_cover_letter(session: CandidateAuth) -> Result<String, Custom<String>> {
|
|
||||||
let candidate: entity::candidate::Model = session.into();
|
|
||||||
|
|
||||||
let exists = PortfolioService::is_cover_letter(candidate.application).await;
|
|
||||||
|
|
||||||
Ok(exists.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/portfolio_letter", data = "<letter>")]
|
#[post("/portfolio_letter", data = "<letter>")]
|
||||||
pub async fn upload_portfolio_letter(
|
pub async fn upload_portfolio_letter(
|
||||||
|
|
@ -155,16 +146,6 @@ pub async fn upload_portfolio_letter(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: JSON
|
|
||||||
#[get["/is_portfolio_letter"]]
|
|
||||||
pub async fn is_portfolio_letter(session: CandidateAuth) -> Result<String, Custom<String>> {
|
|
||||||
let candidate: entity::candidate::Model = session.into();
|
|
||||||
|
|
||||||
let exists = PortfolioService::is_portfolio_letter(candidate.application).await;
|
|
||||||
|
|
||||||
Ok(exists.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/portfolio_zip", data = "<portfolio>")]
|
#[post("/portfolio_zip", data = "<portfolio>")]
|
||||||
pub async fn upload_portfolio_zip(
|
pub async fn upload_portfolio_zip(
|
||||||
session: CandidateAuth,
|
session: CandidateAuth,
|
||||||
|
|
@ -179,16 +160,6 @@ pub async fn upload_portfolio_zip(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: JSON
|
|
||||||
#[get["/is_portfolio_zip"]]
|
|
||||||
pub async fn is_portfolio_zip(session: CandidateAuth) -> Result<String, Custom<String>> {
|
|
||||||
let candidate: entity::candidate::Model = session.into();
|
|
||||||
|
|
||||||
let exists = PortfolioService::is_portfolio_zip(candidate.application).await;
|
|
||||||
|
|
||||||
Ok(exists.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/submit")]
|
#[post("/submit")]
|
||||||
pub async fn submit_portfolio(
|
pub async fn submit_portfolio(
|
||||||
conn: Connection<'_, Db>,
|
conn: Connection<'_, Db>,
|
||||||
|
|
@ -228,42 +199,6 @@ pub async fn delete_portfolio(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "Use /submission_progress instead"]
|
|
||||||
#[get("/is_prepared")]
|
|
||||||
pub async fn is_portfolio_prepared(session: CandidateAuth) -> Result<String, Custom<String>> {
|
|
||||||
let candidate: entity::candidate::Model = session.into();
|
|
||||||
|
|
||||||
let is_ok = PortfolioService::is_portfolio_prepared(candidate.application).await;
|
|
||||||
|
|
||||||
if !is_ok {
|
|
||||||
// TODO: Correct error
|
|
||||||
return Err(Custom(
|
|
||||||
Status::from_code(404).unwrap_or_default(),
|
|
||||||
"Portfolio not prepared".to_string(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok("Portfolio ok".to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "Use /submission_progress instead"]
|
|
||||||
#[get("/is_submitted")]
|
|
||||||
pub async fn is_portfolio_submitted(session: CandidateAuth) -> Result<String, Custom<String>> {
|
|
||||||
let candidate: entity::candidate::Model = session.into();
|
|
||||||
|
|
||||||
let is_ok = PortfolioService::is_portfolio_submitted(candidate.application).await;
|
|
||||||
|
|
||||||
if !is_ok {
|
|
||||||
// TODO: Correct error
|
|
||||||
return Err(Custom(
|
|
||||||
Status::from_code(404).unwrap_or_default(),
|
|
||||||
"Portfolio not submitted".to_string(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok("Portfolio ok".to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/download")]
|
#[get("/download")]
|
||||||
pub async fn download_portfolio(session: CandidateAuth) -> Result<Vec<u8>, Custom<String>> {
|
pub async fn download_portfolio(session: CandidateAuth) -> Result<Vec<u8>, Custom<String>> {
|
||||||
let private_key = session.get_private_key();
|
let private_key = session.get_private_key();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue