mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
17 lines
No EOL
434 B
JavaScript
17 lines
No EOL
434 B
JavaScript
Template.toolbox.events= {
|
|
'click .update-categories':function(){
|
|
var posts=Posts.find().fetch();
|
|
$.each(posts, function(index, element){
|
|
|
|
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);
|
|
});
|
|
|
|
console.log(element);
|
|
}
|
|
});
|
|
}
|
|
} |