Can easily get information about a single user

This commit is contained in:
Pierre HUBERT 2020-04-01 19:05:31 +02:00
parent f3cf290822
commit 589b96d8bb

View File

@ -181,6 +181,22 @@ function getUserInfo(usersID, afterGetUserInfo, forceRequest){
ComunicWeb.user.userInfos.getUserInfos(usersID, afterGetUserInfo, forceRequest); ComunicWeb.user.userInfos.getUserInfos(usersID, afterGetUserInfo, forceRequest);
} }
/**
* Get information about a single user asynchronously
*
* @param {Number} userID Target user ID
*/
function userInfo(userID) {
return new Promise((res, err) => {
getUserInfo(userID, (data) => {
if(data.error)
err(data.error)
else
res(data)
}, false);
});
}
/** /**
* Display message on browser console * Display message on browser console
* *