From f42050fe4422e6fb9c72606cced19f3a73369205 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Wed, 17 Aug 2016 18:45:50 -0400 Subject: [PATCH] joinPrivateClass --- hourglass/server/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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;