Radiks makeGroupInvitation

@hank

Hey Hank, I’m at TreeHacks currently and trying to make groups. I’m pretty much following the code on the radiks repo and getting this error:
group.makeGroupInvitation is not a function

Any ideas?

This is my code snippet:

const group = new UserGroup({ name: 'testingyoyoyoyo' }); // TODO name
        console.log(group);

        (async () => {
            await group.create();
            console.log('two');
            const invitation = await group.makeGroupInvitation(this.state.usernameToInvite);
            console.log(invitation._id); // the ID used to later activate an invitation
        })();

Hey! Looking through the code, I think that method got obsoleted recently. If you’re trying to set up group membership, I think this would be what you want:

const group = new UserGroup({name: 'testingyoyoyoyo' });
(async () => {
   await group.create();
   const invitation = group.makeGroupMembership(this.state.usernameToInvite);
   /* ... */
})();

cc @hank to confirm

1 Like

Looks like it works!