imports/vx/both/code/util.js
/**
     * Return the full name of the specified user.
     *
     * @param {?} userOrId User object or ID.
     * @return {string} Full name of user if available, otherwise email address.
     */
Return the full name of the specified user.
@param {?} userOrId User object or ID.
@return {string} Full name of user if available, otherwise email address.
Return the full name of the specified user . @param { ? } userOrId User object or ID . @return { string } Full name of user if available otherwise email address .
fetchFullName(userOrId) {
        let user
        if (!userOrId) {
            return
        }
        if (_.isObject(userOrId)) {
            user = userOrId
        }
        else {
            user = Meteor.users.findOne({ _id: userOrId }, { fields: { "profile.firstName": 1, "profile.middleName": 1, "profile.lastName": 1 } })
            if (!user) {
                OLog.error("util.js fetchFullName unable to find userOrId=" + userOrId)
                return
            }
        }
        let formattedName = Util.formatFullName(user.profile.firstName, user.profile.middleName, user.profile.lastName)
        if (formattedName) {
            return formattedName
        }
        return Util.getUserEmail(userOrId)
    }
fetchFullName ( userOrId ) { let user if ( ! userOrId ) { return } if ( _ . isObject ( userOrId ) ) { user = userOrId } else { user = Meteor . users . findOne ( { _id : userOrId } , { fields : { "profile.firstName" : 1 , "profile.middleName" : 1 , "profile.lastName" : 1 } } ) if ( ! user ) { OLog . error ( "util.js fetchFullName unable to find userOrId=" + userOrId ) return } } let formattedName = Util . formatFullName ( user . profile . firstName , user . profile . middleName , user . profile . lastName ) if ( formattedName ) { return formattedName } return Util . getUserEmail ( userOrId ) }
Return the full name of the specified user.
Return the full name of the specified user .