Răsfoiți Sursa

Show attachment name in Outgoing Webhook when attachment is added to card.

Thanks to xet7 !

Related #2285
Lauri Ojansivu 6 ani în urmă
părinte
comite
992ecfefa2
2 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 2 1
      models/activities.js
  2. 1 1
      server/notifications/outgoing.js

+ 2 - 1
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();

+ 1 - 1
server/notifications/outgoing.js

@@ -18,7 +18,7 @@ Meteor.methods({
 
     // label activity did not work yet, see wekan/models/activities.js
     const quoteParams = _.clone(params);
-    ['card', 'list', 'oldList', 'board', 'oldBoard', 'comment', 'checklist', 'swimlane', 'oldSwimlane', 'label'].forEach((key) => {
+    ['card', 'list', 'oldList', 'board', 'oldBoard', 'comment', 'checklist', 'swimlane', 'oldSwimlane', 'label', 'attachment'].forEach((key) => {
       if (quoteParams[key]) quoteParams[key] = `"${params[key]}"`;
     });