1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 13:29:21 +00:00

Get user virtual directory

This commit is contained in:
Pierre HUBERT 2020-05-26 13:18:38 +02:00
parent eb3e6e9afa
commit d355f33cb0
3 changed files with 5 additions and 1 deletions

View File

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

View File

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

View File

@ -40,6 +40,7 @@ fn exec_get_user_query(query: database::QueryInfo) -> ResultBoxError<User> {
first_name: res.get_str("prenom")?,
last_name: res.get_str("nom")?,
status: page_status,
virtual_directory: res.get_optional_str("sous_repertoire")?,
})
})
}