mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 01:24:04 +00:00 
			
		
		
		
	Get user virtual directory
This commit is contained in:
		@@ -13,6 +13,7 @@ pub struct APIUserInfo {
 | 
				
			|||||||
    lastName: String,
 | 
					    lastName: String,
 | 
				
			||||||
    publicPage: bool,
 | 
					    publicPage: bool,
 | 
				
			||||||
    openPage: bool,
 | 
					    openPage: bool,
 | 
				
			||||||
 | 
					    virtualDirectory: String,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl APIUserInfo {
 | 
					impl APIUserInfo {
 | 
				
			||||||
@@ -23,6 +24,7 @@ impl APIUserInfo {
 | 
				
			|||||||
            lastName: info.last_name,
 | 
					            lastName: info.last_name,
 | 
				
			||||||
            publicPage: info.status != UserPageStatus::PRIVATE,
 | 
					            publicPage: info.status != UserPageStatus::PRIVATE,
 | 
				
			||||||
            openPage: info.status == UserPageStatus::OPEN,
 | 
					            openPage: info.status == UserPageStatus::OPEN,
 | 
				
			||||||
 | 
					            virtualDirectory: info.virtual_directory.unwrap_or("".to_string())
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -18,5 +18,6 @@ pub struct User {
 | 
				
			|||||||
    pub password: String,
 | 
					    pub password: String,
 | 
				
			||||||
    pub first_name: String,
 | 
					    pub first_name: String,
 | 
				
			||||||
    pub last_name: String,
 | 
					    pub last_name: String,
 | 
				
			||||||
    pub status: UserPageStatus
 | 
					    pub status: UserPageStatus,
 | 
				
			||||||
 | 
					    pub virtual_directory: Option<String>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -40,6 +40,7 @@ fn exec_get_user_query(query: database::QueryInfo) -> ResultBoxError<User> {
 | 
				
			|||||||
            first_name: res.get_str("prenom")?,
 | 
					            first_name: res.get_str("prenom")?,
 | 
				
			||||||
            last_name: res.get_str("nom")?,
 | 
					            last_name: res.get_str("nom")?,
 | 
				
			||||||
            status: page_status,
 | 
					            status: page_status,
 | 
				
			||||||
 | 
					            virtual_directory: res.get_optional_str("sous_repertoire")?,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user