Vulcan/collections/categories.js
Christian Bundy 86ec3ede93 Solve trivial JS errors
Using jshint and and fixmyjs I went through and removed 220 trivial
Javascript errors – mostly missing semicolons, and some properties that
weren’t written in dot notation. You can view the diff of jshint’s
output here:
https://gist.github.com/christianbundy/7b37c51bb6f7c8d739e7/revisions
2014-05-06 20:15:48 -07:00

16 lines
No EOL
420 B
JavaScript

Categories = new Meteor.Collection('categories');
Categories.allow({
insert: isAdminById
, update: isAdminById
, remove: isAdminById
});
Meteor.methods({
category: function(category){
if (!Meteor.user() || !isAdmin(Meteor.user()))
throw new Meteor.Error(i18n.t('You need to login and be an admin to add a new category.'));
var categoryId=Categories.insert(category);
return category.name;
}
});