mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-05 11:00:56 +00:00
fix: create candidate error
This commit is contained in:
parent
2d9b755e5a
commit
3bef8d9534
2 changed files with 9 additions and 3 deletions
|
|
@ -51,7 +51,7 @@ impl<'r> FromRequest<'r> for AdminAuth {
|
||||||
match session {
|
match session {
|
||||||
Ok(model) => Outcome::Success(AdminAuth(model, private_key.to_string())),
|
Ok(model) => Outcome::Success(AdminAuth(model, private_key.to_string())),
|
||||||
Err(e) => Outcome::Failure(
|
Err(e) => Outcome::Failure(
|
||||||
(Status::from_code(e.code()).unwrap_or(Status::InternalServerError), None)
|
(Status::from_code(e.code()).unwrap_or(Status::Unauthorized), None)
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,16 @@ 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!(
|
/* tokio::try_join!( // TODO: try_join! is not working
|
||||||
CandidateService::create(db, application_id, plain_text_password, personal_id_number),
|
CandidateService::create(db, application_id, plain_text_password, personal_id_number),
|
||||||
ParentService::create(db, application_id)
|
ParentService::create(db, application_id)
|
||||||
)?
|
)? */
|
||||||
|
|
||||||
|
|
||||||
|
(
|
||||||
|
CandidateService::create(db, application_id, plain_text_password, personal_id_number).await?,
|
||||||
|
ParentService::create(db, application_id).await?
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue