mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-17 05:21:07 +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::submission_progress,
|
||||
routes::candidate::download_portfolio,
|
||||
routes::candidate::delete_portfolio,
|
||||
],
|
||||
)
|
||||
.mount(
|
||||
|
|
|
|||
|
|
@ -214,6 +214,20 @@ pub async fn submit_portfolio(
|
|||
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"]
|
||||
#[get("/is_prepared")]
|
||||
pub async fn is_portfolio_prepared(session: CandidateAuth) -> Result<String, Custom<String>> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue