joinPrivateClass

This commit is contained in:
Yaman Qalieh 2016-08-17 18:45:50 -04:00
parent bd52504d25
commit f42050fe44

View File

@ -412,6 +412,14 @@ Meteor.methods({
return 0; 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) { 'leaveClass': function(change) {
if (Meteor.user() !== null) { if (Meteor.user() !== null) {
var profile = Meteor.user().profile; var profile = Meteor.user().profile;