Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
remove specialty
removeSpecialty: function(options) {
var userId = options.userId;
var toRemove = options.specialty || {};
var topic = Topics.findOne({name:toRemove.name});
var user = Meteor.users.findOne(userId)
if(!user)
throw new Meteor.Error("User not found")
if(!topic)
throw new Meteor.Error("Topic not found")
var current = _.map(user.profile.specialties, function(obj){return obj._id})
if(_.isObject(topic)) {
if(_.contains(current,topic._id)) {
Meteor.users.remove({_id: topic._id})
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.