diff --git a/src/api_data/user_info.rs b/src/api_data/user_info.rs index 7e79eff..21e3eeb 100644 --- a/src/api_data/user_info.rs +++ b/src/api_data/user_info.rs @@ -13,6 +13,7 @@ pub struct APIUserInfo { lastName: String, publicPage: bool, openPage: bool, + virtualDirectory: String, } impl APIUserInfo { @@ -23,6 +24,7 @@ impl APIUserInfo { lastName: info.last_name, publicPage: info.status != UserPageStatus::PRIVATE, openPage: info.status == UserPageStatus::OPEN, + virtualDirectory: info.virtual_directory.unwrap_or("".to_string()) } } } \ No newline at end of file diff --git a/src/data/user.rs b/src/data/user.rs index bd33958..feb6fc4 100644 --- a/src/data/user.rs +++ b/src/data/user.rs @@ -18,5 +18,6 @@ pub struct User { pub password: String, pub first_name: String, pub last_name: String, - pub status: UserPageStatus + pub status: UserPageStatus, + pub virtual_directory: Option, } \ No newline at end of file diff --git a/src/helpers/user_helper.rs b/src/helpers/user_helper.rs index 2fee007..b2c1bd2 100644 --- a/src/helpers/user_helper.rs +++ b/src/helpers/user_helper.rs @@ -40,6 +40,7 @@ fn exec_get_user_query(query: database::QueryInfo) -> ResultBoxError { first_name: res.get_str("prenom")?, last_name: res.get_str("nom")?, status: page_status, + virtual_directory: res.get_optional_str("sous_repertoire")?, }) }) } \ No newline at end of file