Added module 'authenticationDefault/get_admins' to fetch all admins of the warehouse
This commit is contained in:
parent
a5b22a4836
commit
6b123765b6
|
@ -122,7 +122,30 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* RETOURNE LA LISTE DSE ADMINISTRATEURS DE L'ENTREPOT
|
||||||
|
*
|
||||||
|
* @return admins<array> Liste des administrateurs de l'entrepôt
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function get_admins($params){
|
||||||
|
/* (1) Fetch admin list
|
||||||
|
---------------------------------------------------------*/
|
||||||
|
/* (1) Prepare request */
|
||||||
|
$listRq = new Repo('admin/getByIdWarehouse', [ $_SESSION['WAREHOUSE']['id'] ]);
|
||||||
|
|
||||||
|
/* (2) Get response */
|
||||||
|
$listRs = $listRq->answer();
|
||||||
|
|
||||||
|
/* (3) Manage error */
|
||||||
|
if( !is_array($listRs) )
|
||||||
|
return ['error' => new Error(Err::RepoError)];
|
||||||
|
|
||||||
|
|
||||||
|
/* (2) Setup data (remove self)
|
||||||
|
---------------------------------------------------------*/
|
||||||
|
return ['admins' => $listRs];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"POST::get_admins": {
|
||||||
|
"description": "Retourne la liste des administrateurs de l'entrepôt.",
|
||||||
|
"permissions": [["admin"]],
|
||||||
|
"parameters": {},
|
||||||
|
"output": {
|
||||||
|
"admin": { "description": "Liste des administrateur.", "type": "array" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"POST::update_admin": {
|
"POST::update_admin": {
|
||||||
"description": "Changement de mot de passe administrateur",
|
"description": "Changement de mot de passe administrateur",
|
||||||
"permissions": [["admin"]],
|
"permissions": [["admin"]],
|
||||||
|
|
|
@ -160,6 +160,7 @@
|
||||||
"getAll",
|
"getAll",
|
||||||
"getById",
|
"getById",
|
||||||
"getByUsername",
|
"getByUsername",
|
||||||
|
"getByIdWarehouse",
|
||||||
"getByMail",
|
"getByMail",
|
||||||
"getByToken",
|
"getByToken",
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue