Added - auto update card cover with latest uploaded image attachment of card

This commit is contained in:
Thuan Pham Quoc 2017-12-09 00:36:23 +07:00
parent e2f768c6a0
commit 84d60b5908

View file

@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.events({
file.boardId = card.boardId;
file.cardId = card._id;
file.userId = Meteor.userId();
Attachments.insert(file);
const attachment = Attachments.insert(file);
if (attachment && attachment._id && attachment.isImage()) {
card.setCover(attachment._id);
}
Popup.close();
});
},