mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
don't need updateCategoryInPosts method anymore (fix #590)
This commit is contained in:
parent
2eb31e0647
commit
5b72a09c7d
2 changed files with 0 additions and 27 deletions
|
@ -11,11 +11,6 @@ Meteor.startup(function () {
|
|||
}else{
|
||||
Categories.remove(categoryId);
|
||||
}
|
||||
Meteor.call('updateCategoryInPosts', categoryId, function(error) {
|
||||
if (error) {
|
||||
throwError(error.reason);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
|
@ -15,27 +15,5 @@ Meteor.methods({
|
|||
giveInvites: function () {
|
||||
if(isAdmin(Meteor.user()))
|
||||
Meteor.users.update({}, {$inc:{inviteCount: 1}}, {multi:true});
|
||||
},
|
||||
updateCategoryInPosts: function (categoryId) {
|
||||
check(categoryId, String);
|
||||
|
||||
if (!isAdmin(Meteor.user()))
|
||||
throw new Meteor.Error(403, "Not an admin");
|
||||
|
||||
var category = Categories.findOne(categoryId);
|
||||
if (!category) {
|
||||
Posts.update(
|
||||
{}
|
||||
, {$pull: {categories: {_id: categoryId}}}
|
||||
, {multi: true}
|
||||
);
|
||||
} else {
|
||||
// Such update is server-only, because Minimongo does not support $ yet
|
||||
Posts.update(
|
||||
{'categories._id': categoryId}
|
||||
, {$set: {'categories.$': category}}
|
||||
, {multi: true}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Reference in a new issue