mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-09 13:00:49 +00:00
feat: async create candidate, async add details
This commit is contained in:
parent
c238b8ec45
commit
2d9b755e5a
1 changed files with 8 additions and 8 deletions
|
|
@ -15,10 +15,10 @@ impl ApplicationService {
|
||||||
personal_id_number: String,
|
personal_id_number: String,
|
||||||
) -> Result<(candidate::Model, parent::Model), ServiceError> {
|
) -> Result<(candidate::Model, parent::Model), ServiceError> {
|
||||||
Ok(
|
Ok(
|
||||||
(
|
tokio::try_join!(
|
||||||
CandidateService::create(db, application_id, plain_text_password, personal_id_number).await?,
|
CandidateService::create(db, application_id, plain_text_password, personal_id_number),
|
||||||
ParentService::create(db, application_id).await?
|
ParentService::create(db, application_id)
|
||||||
)
|
)?
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,10 +50,10 @@ impl ApplicationService {
|
||||||
let enc_details = EncryptedApplicationDetails::new(form, recipients).await?;
|
let enc_details = EncryptedApplicationDetails::new(form, recipients).await?;
|
||||||
|
|
||||||
Ok(
|
Ok(
|
||||||
(
|
tokio::try_join!(
|
||||||
CandidateService::add_candidate_details(db, candidate, enc_details.clone()).await?,
|
CandidateService::add_candidate_details(db, candidate, enc_details.clone()),
|
||||||
ParentService::add_parent_details(db, parent, enc_details.clone()).await?
|
ParentService::add_parent_details(db, parent, enc_details.clone())
|
||||||
)
|
)?
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue