Refuse to delete a card as long as there is link to it

This fixes https://github.com/wekan/wekan/issues/2785.
This commit is contained in:
Marc Hartmayer 2020-04-30 01:03:37 +02:00
parent 2691f033cb
commit b740381a72
2 changed files with 25 additions and 3 deletions

View file

@ -967,7 +967,12 @@ BlazeComponent.extendComponent({
},
'click .js-delete': Popup.afterConfirm('cardDelete', function() {
Popup.close();
Cards.remove(this._id);
// verify that there are no linked cards
if (Cards.find({ linkedId: this._id }).count() === 0) {
Cards.remove(this._id);
} else {
// TODO popup...
}
Utils.goBoardId(this.boardId);
}),
'change .js-field-parent-board'(event) {