summaryrefslogtreecommitdiffstats
path: root/models/attachments.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-06-11 13:11:35 +0300
committerLauri Ojansivu <x@xet7.org>2019-06-11 13:11:35 +0300
commit23ccb3b991be6d7196e59f7d68df17b8949df049 (patch)
tree2737b07f985b39164f1553b4168b8edfab0bd675 /models/attachments.js
parent992ecfefa2e46ee7321ec9b8bfc3400532e5645e (diff)
downloadwekan-23ccb3b991be6d7196e59f7d68df17b8949df049.tar.gz
wekan-23ccb3b991be6d7196e59f7d68df17b8949df049.tar.bz2
wekan-23ccb3b991be6d7196e59f7d68df17b8949df049.zip
Show attachment name in Outgoing Webhook when attachment is removed from card.
Thanks to xet7 ! Related #2285
Diffstat (limited to 'models/attachments.js')
-rw-r--r--models/attachments.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/models/attachments.js b/models/attachments.js
index fb32f497..71b30eee 100644
--- a/models/attachments.js
+++ b/models/attachments.js
@@ -88,18 +88,22 @@ if (Meteor.isServer) {
}
});
- Attachments.files.after.remove((userId, doc) => {
- Activities.remove({
- attachmentId: doc._id,
- });
+ Attachments.files.before.remove((userId, doc) => {
Activities.insert({
userId,
type: 'card',
activityType: 'deleteAttachment',
+ attachmentId: doc._id,
boardId: doc.boardId,
cardId: doc.cardId,
listId: doc.listId,
swimlaneId: doc.swimlaneId,
});
});
+
+ Attachments.files.after.remove((userId, doc) => {
+ Activities.remove({
+ attachmentId: doc._id,
+ });
+ });
}