mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
12 lines
No EOL
289 B
JavaScript
12 lines
No EOL
289 B
JavaScript
Meteor.methods({
|
|
category: function(category){
|
|
var user = Meteor.user();
|
|
|
|
if (!user || !isAdmin(user))
|
|
throw new Meteor.Error('You need to login and be an admin to add a new category.')
|
|
|
|
var categoryId=Categories.insert(category);
|
|
|
|
return category.name;
|
|
}
|
|
}); |