mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can get the list of groups of a user
This commit is contained in:
@ -505,6 +505,26 @@ class GroupsController {
|
||||
return array("success" => "Membership invitation has been cancelled !");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of membership of the current user
|
||||
*
|
||||
* @url POST groups/get_my_list
|
||||
*/
|
||||
public function getMyList() : array {
|
||||
|
||||
user_login_required();
|
||||
|
||||
//Get the list of groups of the user
|
||||
$list = components()->groups->getListUser(userID);
|
||||
|
||||
//Parse list
|
||||
foreach($list as $num => $info)
|
||||
$list[$num] = self::GroupInfoToAPI($info);
|
||||
|
||||
return $list;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a GroupInfo object into an array for the API
|
||||
*
|
||||
|
Reference in New Issue
Block a user