liquido.mongoDB.js
/** New user wants to join an existing team. User will be created. */
New user wants to join an existing team. User will be created.
New user wants to join an existing team . User will be created .
async function joinTeam(inviteCode, username, userEmail) {
	if (arguments.length === 1) {
		var { inviteCode, username, userEmail } = arguments[0]
	}
	LOG.info("joinTeam(inviteCode=" + inviteCode + ")")
	let team = await Team.findOne({ inviteCode: inviteCode })
	if (!team) return Promise.reject("Cannot joinTeam: inviteCode " + inviteCode + " is invalid!")
	let newUser = { name: username, email: userEmail }
	team.members.push(newUser)
	return team.save()
}
async function joinTeam ( inviteCode , username , userEmail ) { if ( arguments . length === 1 ) { var { inviteCode , username , userEmail } = arguments [ 0 ] } LOG . info ( "joinTeam(inviteCode=" + inviteCode + ")" ) let team = await Team . findOne ( { inviteCode : inviteCode } ) if ( ! team ) return Promise . reject ( "Cannot joinTeam: inviteCode " + inviteCode + " is invalid!" ) let newUser = { name : username , email : userEmail } team . members . push ( newUser ) return team . save ( ) }
New user wants to join an existing team.
New user wants to join an existing team .