diff --git a/assets/js/common/shorcuts.js b/assets/js/common/shorcuts.js index ad1b0539..8d64e181 100644 --- a/assets/js/common/shorcuts.js +++ b/assets/js/common/shorcuts.js @@ -181,6 +181,22 @@ function getUserInfo(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 *