1
0
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:
2021-05-15 09:19:43 +02:00
parent d933dadf62
commit cbf8d9b100
3 changed files with 17 additions and 0 deletions

View File

@ -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") {