mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Created groups members table.
This commit is contained in:
@ -160,4 +160,18 @@ ComunicWeb.components.groups.interface = {
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the members of a group
|
||||
*
|
||||
* @param {Number} id The ID of the target group
|
||||
* @param {Function} callback
|
||||
*/
|
||||
getMembers: function(id, callback){
|
||||
//Perform the request over the API
|
||||
var apiURI = "groups/get_members";
|
||||
var params = {
|
||||
id: id
|
||||
};
|
||||
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
|
||||
}
|
||||
};
|
28
assets/js/components/groups/utils.js
Normal file
28
assets/js/components/groups/utils.js
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Groups utilities
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.components.groups.utils = {
|
||||
|
||||
/**
|
||||
* Extract users ids from members list
|
||||
*
|
||||
* @param {Array} list The list of members to process
|
||||
* @return {Array} The list of the IDs of the members of group
|
||||
*/
|
||||
getMembersIDs: function(list){
|
||||
|
||||
var IDs = [];
|
||||
|
||||
//Process the list of IDs
|
||||
list.forEach(function(member){
|
||||
IDs.push(member.user_id);
|
||||
});
|
||||
|
||||
return IDs;
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user