mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 08:25:16 +00:00
Can get the list of administrators from the api
This commit is contained in:
@ -55,6 +55,16 @@ pub fn get_admin_id(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
r.set_response(AdminIDAPI::new(r.admin_id()?))
|
||||
}
|
||||
|
||||
/// Get and return the list of administrators
|
||||
pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let list = admin_account_helper::get_list()?
|
||||
.iter()
|
||||
.map(AdminInfoAPI::new)
|
||||
.collect::<Vec<AdminInfoAPI>>();
|
||||
|
||||
r.set_response(list)
|
||||
}
|
||||
|
||||
/// Get current admin information
|
||||
pub fn get_admin_info(r: &mut HttpRequestHandler) -> RequestResult {
|
||||
let admin = match r.has_post_parameter("id") {
|
||||
|
Reference in New Issue
Block a user