feat: add fieldOfStudy to backend response

This commit is contained in:
EETagent 2023-01-15 23:36:04 +01:00
parent b44ce9c559
commit ed53640263
2 changed files with 3 additions and 1 deletions

View file

@ -12,6 +12,7 @@ pub struct ApplicationCandidateJoin {
pub surname: Option<String>,
pub email: Option<String>,
pub telephone: Option<String>,
pub field_of_study: Option<String>,
}
use crate::{Query};

View file

@ -14,6 +14,7 @@ pub struct ApplicationResponse {
pub surname: String,
pub email: String,
pub telephone: String,
pub field_of_study: Option<String>,
}
impl ApplicationResponse {
@ -25,7 +26,6 @@ impl ApplicationResponse {
let surname = EncryptedString::decrypt_option(&EncryptedString::try_from(&c.surname).ok(), private_key).await?;
let email = EncryptedString::decrypt_option(&EncryptedString::try_from(&c.email).ok(), private_key).await?;
let telephone = EncryptedString::decrypt_option(&EncryptedString::try_from(&c.telephone).ok(), private_key).await?;
Ok(
Self {
application_id: c.application_id,
@ -34,6 +34,7 @@ impl ApplicationResponse {
email: email.unwrap_or_default(),
telephone: telephone.unwrap_or_default(),
candidate_id: c.candidate_id,
field_of_study: c.field_of_study,
}
)
}