remove feature

This commit is contained in:
guillaume 2019-04-23 18:00:09 +02:00
parent 6933424fca
commit 8137f2692f
10 changed files with 135 additions and 14 deletions

View file

@ -217,6 +217,10 @@ Lists.helpers({
isTemplateList() {
return this.type === 'template-list';
},
remove() {
Lists.remove({ _id: this._id});
},
});
Lists.mutations({
@ -310,6 +314,12 @@ if (Meteor.isServer) {
});
Lists.before.remove((userId, doc) => {
const cards = Cards.find({ listId: doc._id });
if (cards) {
cards.forEach((card) => {
Cards.remove(card._id);
});
}
Activities.insert({
userId,
type: 'list',