Created groups members table.

This commit is contained in:
Pierre HUBERT
2018-07-07 15:27:27 +02:00
parent 0be49b0d35
commit e805dda4fb
8 changed files with 272 additions and 2 deletions

View File

@ -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);
}
};

View 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;
}
}