summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/activities.js3
-rw-r--r--models/attachments.js12
2 files changed, 10 insertions, 5 deletions
diff --git a/models/activities.js b/models/activities.js
index 1e97895d..a4a48284 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -166,7 +166,8 @@ if (Meteor.isServer) {
}
if (activity.attachmentId) {
const attachment = activity.attachment();
- params.attachment = attachment._id;
+ params.attachment = attachment.original.name;
+ params.attachmentId = attachment._id;
}
if (activity.checklistId) {
const checklist = activity.checklist();
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,
+ });
+ });
}