mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-27 03:08:51 +00:00
29 lines
508 B
JavaScript
29 lines
508 B
JavaScript
|
/**
|
||
|
* 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 = [];
|
||
|
list.forEach(friend => {
|
||
|
//Extract user id
|
||
|
usersID.push(friend.ID_friend);
|
||
|
});
|
||
|
|
||
|
//Return the generated list
|
||
|
return usersID;
|
||
|
},
|
||
|
|
||
|
|
||
|
}
|