I did a quick reference on the tutorial, and yet I am still getting error when I am trying to remove a document, that already exists in my collection. I am able to create new documents
, however I am unable to delete
them. It says that I need permission, even though I allowed my collection to have access.
app/public/collection.js
const Pet = new Mongo.Collection('pet');
Pet.allow({
insert: function() {
return true;
},
update: function() {
return true;
},
remove: function() {
return true;
}
});
app/server/publish.js
const Pet = new Mongo.Collection('pet');
Meteor.publish('pet', function() {
return Pet.find();
}
client/view/pet/petshow.js
Template.edit_delete_form.events({
'click .delete': function(e) {
Pet.remove(this._id);
e.preventDefault();
}
});
Any help would be much appreciated.