diff --git a/api/src/guards/request/auth/admin.rs b/api/src/guards/request/auth/admin.rs index 8f75a31..717e41a 100644 --- a/api/src/guards/request/auth/admin.rs +++ b/api/src/guards/request/auth/admin.rs @@ -51,7 +51,7 @@ impl<'r> FromRequest<'r> for AdminAuth { match session { Ok(model) => Outcome::Success(AdminAuth(model, private_key.to_string())), Err(e) => Outcome::Failure( - (Status::from_code(e.code()).unwrap_or(Status::InternalServerError), None) + (Status::from_code(e.code()).unwrap_or(Status::Unauthorized), None) ), } diff --git a/core/src/services/application_service.rs b/core/src/services/application_service.rs index eed8881..5793162 100644 --- a/core/src/services/application_service.rs +++ b/core/src/services/application_service.rs @@ -15,10 +15,16 @@ impl ApplicationService { personal_id_number: String, ) -> Result<(candidate::Model, parent::Model), ServiceError> { Ok( - tokio::try_join!( + /* tokio::try_join!( // TODO: try_join! is not working CandidateService::create(db, application_id, plain_text_password, personal_id_number), ParentService::create(db, application_id) - )? + )? */ + + + ( + CandidateService::create(db, application_id, plain_text_password, personal_id_number).await?, + ParentService::create(db, application_id).await? + ) ) }