Added a delete confirmation modal to all views.

This commit is contained in:
Brian McGonagill 2022-08-26 11:18:18 -05:00
parent 4d9d2acff6
commit 29ddc544e5
27 changed files with 117 additions and 127 deletions

View file

@ -45,13 +45,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete categories. Make sure you are logged in with valid user credentials.');
}
let categoryInfo = Categories.findOne({ _id: categoryId });
let myId = this.userId;
if (myId == categoryInfo.owner) {
return Categories.remove({ _id: categoryId });
} else {
console.log("User not allowed to delete this Category. Not the owner!");
return("Not Allowed!");
}
return Categories.remove({ _id: categoryId });
},
});