Added restore swimlane and swimlane title to webhooks

pull/5205/head
Gustav Engström 2 years ago
parent 1dd97ebd49
commit 832bd6187c
  1. 31
      models/swimlanes.js

@ -371,14 +371,39 @@ if (Meteor.isServer) {
});
});
Swimlanes.after.update((userId, doc) => {
if (doc.archived) {
Swimlanes.after.update((userId, doc, fieldNames) => {
if (fieldNames.includes('title')) {
Activities.insert({
userId,
type: 'swimlane',
activityType: 'changedSwimlaneTitle',
listId: doc._id,
boardId: doc.boardId,
// this preserves the name so that the activity can be useful after the
// list is deleted
title: doc.title,
});
} else if (doc.archived) {
Activities.insert({
userId,
type: 'swimlane',
activityType: 'archivedSwimlane',
swimlaneId: doc._id,
listId: doc._id,
boardId: doc.boardId,
// this preserves the name so that the activity can be useful after the
// list is deleted
title: doc.title,
});
} else if (fieldNames.includes('archived')) {
Activities.insert({
userId,
type: 'swimlane',
activityType: 'restoredSwimlane',
listId: doc._id,
boardId: doc.boardId,
// this preserves the name so that the activity can be useful after the
// list is deleted
title: doc.title,
});
}
});

Loading…
Cancel
Save