mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-08 04:20:46 +00:00
refactor: no restrict access arg
This commit is contained in:
parent
3e2481e336
commit
1a95f46ba1
3 changed files with 2 additions and 9 deletions
|
|
@ -167,8 +167,7 @@ pub async fn get_candidate(
|
||||||
let details = ApplicationService::decrypt_all_details(
|
let details = ApplicationService::decrypt_all_details(
|
||||||
private_key,
|
private_key,
|
||||||
db,
|
db,
|
||||||
&application,
|
&application
|
||||||
false,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(to_custom_error)?;
|
.map_err(to_custom_error)?;
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,7 @@ pub async fn get_details(
|
||||||
let details = ApplicationService::decrypt_all_details(
|
let details = ApplicationService::decrypt_all_details(
|
||||||
private_key,
|
private_key,
|
||||||
db,
|
db,
|
||||||
&application,
|
&application
|
||||||
true
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|x| Json(x))
|
.map(|x| Json(x))
|
||||||
|
|
|
||||||
|
|
@ -215,14 +215,9 @@ impl ApplicationService {
|
||||||
private_key: String,
|
private_key: String,
|
||||||
db: &DbConn,
|
db: &DbConn,
|
||||||
application: &application::Model,
|
application: &application::Model,
|
||||||
restrict_access: bool,
|
|
||||||
) -> Result<ApplicationDetails, ServiceError> {
|
) -> Result<ApplicationDetails, ServiceError> {
|
||||||
let candidate = ApplicationService::find_related_candidate(db, application).await?;
|
let candidate = ApplicationService::find_related_candidate(db, application).await?;
|
||||||
|
|
||||||
/* if restrict_access && candidate.encrypted_by_id.is_some() && candidate.encrypted_by_id != Some(application.id) {
|
|
||||||
return Err(ServiceError::Locked)
|
|
||||||
} */
|
|
||||||
|
|
||||||
let parents = Query::find_candidate_parents(db, &candidate).await?;
|
let parents = Query::find_candidate_parents(db, &candidate).await?;
|
||||||
let enc_details = EncryptedApplicationDetails::from((&candidate, parents));
|
let enc_details = EncryptedApplicationDetails::from((&candidate, parents));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue