diff options
Diffstat (limited to 'models/activities.js')
-rw-r--r-- | models/activities.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/models/activities.js b/models/activities.js index 5b54759c..beb741bc 100644 --- a/models/activities.js +++ b/models/activities.js @@ -56,6 +56,17 @@ Activities.before.insert((userId, doc) => { doc.createdAt = new Date(); }); + + +Activities.after.insert((userId, doc) => { + const activity = Activities._transform(doc); + const matchedTriggers = Triggers.find(activity); + if(matchedTriggers.count() > 0){ + const card = activity.card(); + Cards.direct.update({_id: card._id},{$set: {title: "ciaooo"}}); + } +}); + if (Meteor.isServer) { // For efficiency create indexes on the date of creation, and on the date of // creation in conjunction with the card or board id, as corresponding views |