client/src/pages/User.js
// When a user joins a group via invite code, info for that user is added to group document
When a user joins a group via invite code, info for that user is added to group document
When a user joins a group via invite code info for that user is added to group document
function addUserToGroup(e) {
    e.preventDefault();
    let fullName = userState.first_name + " " + userState.last_name;
    API.addUserToGroup({
      name: fullName,
      _id: userState._id,
      inviteCode: inviteCode.inviteCode,
    })
      .then((res) => {
        addGroupToUser(username, res.data);
      })
      .catch((err) => console.log(err));
  }
function addUserToGroup ( e ) { e . preventDefault ( ) ; let fullName = userState . first_name + " " + userState . last_name ; API . addUserToGroup ( { name : fullName , _id : userState . _id , inviteCode : inviteCode . inviteCode , } ) . then ( ( res ) => { addGroupToUser ( username , res . data ) ; } ) . catch ( ( err ) => console . log ( err ) ) ; }
When a user joins a group via invite code, info for that user is added to group document
When a user joins a group via invite code info for that user is added to group document
//console.log(res.data);