Vulcan/client/views/admin/toolbox.js

20 lines
533 B
JavaScript
Raw Normal View History

2013-04-05 12:22:00 +09:00
Template.toolbox.events= {
'click .update-categories':function(){
2013-10-23 19:43:42 +09:00
var posts=Posts.find().fetch();
$.each(posts, function(index, element){
2013-04-05 12:22:00 +09:00
2013-10-23 19:43:42 +09:00
if(element.categories){
console.log('Found categories for post "'+element.headline+'"');
$.each(element.categories)
Posts.update(element._id,{$set:{userId:element.user_id}}, function(error){
console.log(error);
});
2013-04-05 12:22:00 +09:00
2013-10-23 19:43:42 +09:00
console.log(element);
}
});
},
'click .give-invites':function(){
Meteor.call('giveInvites');
}
2013-04-05 12:22:00 +09:00
}