fix: create candidate error

This commit is contained in:
Sebastian Pravda 2022-11-12 11:42:39 +01:00
parent 2d9b755e5a
commit 3bef8d9534
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
2 changed files with 9 additions and 3 deletions

View file

@ -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)
), ),
} }

View file

@ -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?
)
) )
} }