mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-05 02:50:47 +00:00
feat: delete portfolio candidate endpoint
This commit is contained in:
parent
c81beac1c3
commit
211ed722ca
2 changed files with 15 additions and 0 deletions
|
|
@ -94,6 +94,7 @@ pub fn rocket() -> Rocket<Build>{
|
||||||
routes::candidate::is_portfolio_submitted,
|
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,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.mount(
|
.mount(
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,20 @@ pub async fn submit_portfolio(
|
||||||
Ok("Portfolio submitted".to_string())
|
Ok("Portfolio submitted".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[post("/delete")]
|
||||||
|
pub async fn delete_portfolio(
|
||||||
|
conn: Connection<'_, Db>,
|
||||||
|
session: CandidateAuth,
|
||||||
|
) -> Result<String, Custom<String>> {
|
||||||
|
let candidate: entity::candidate::Model = session.into();
|
||||||
|
|
||||||
|
PortfolioService::delete_portfolio(candidate.application)
|
||||||
|
.await
|
||||||
|
.map_err(to_custom_error)?;
|
||||||
|
|
||||||
|
Ok("Portfolio deleted".to_string())
|
||||||
|
}
|
||||||
|
|
||||||
#[deprecated = "Use /submission_progress instead"]
|
#[deprecated = "Use /submission_progress instead"]
|
||||||
#[get("/is_prepared")]
|
#[get("/is_prepared")]
|
||||||
pub async fn is_portfolio_prepared(session: CandidateAuth) -> Result<String, Custom<String>> {
|
pub async fn is_portfolio_prepared(session: CandidateAuth) -> Result<String, Custom<String>> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue