ComunicWeb/assets/js/components/friends/utils.js

29 lines
514 B
JavaScript
Raw Permalink Normal View History

2018-03-07 18:42:18 +00:00
/**
* Friends component utilities
*
* @author Pierre HUBERT
*/
ComunicWeb.components.friends.utils = {
/**
* Extract the IDs of the friends of the users from a friends list
*
* @param {array} list The friends list to process
* @return {array} The list of IDs
*/
getUsersIdFromPersonnalList: function(list){
//Parse the list
usersID = [];
2018-04-24 18:19:00 +00:00
list.forEach(function(friend){
2018-03-07 18:42:18 +00:00
//Extract user id
usersID.push(friend.ID_friend);
});
//Return the generated list
return usersID;
},
}