diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 5a3a0ef..33799fe 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -412,6 +412,14 @@ Meteor.methods({ return 0; } }, + 'joinPrivateClass': function(input) { + var found = classes.findOne(input); + if (found !== undefined && input.code !== undefined) { + current = Meteor.user().profile; + current.concat(found._id); + Meteor.users.update({_id: Meteor.userId()}, {$set: {profile: current}}); + } + }, 'leaveClass': function(change) { if (Meteor.user() !== null) { var profile = Meteor.user().profile;