Merge pull request #5198 from gustavengstrom/master

Added restore list and changing list title to outgoing webhooks
This commit is contained in:
Lauri Ojansivu 2023-11-14 02:15:39 +02:00 committed by GitHub
commit fc387d0ddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -453,8 +453,19 @@ if (Meteor.isServer) {
});
});
Lists.after.update((userId, doc) => {
if (doc.archived) {
Lists.after.update((userId, doc, fieldNames) => {
if (fieldNames.includes('title')) {
Activities.insert({
userId,
type: 'list',
activityType: 'changedListTitle',
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: 'list',
@ -465,6 +476,17 @@ if (Meteor.isServer) {
// list is deleted
title: doc.title,
});
} else if (fieldNames.includes('archived')) {
Activities.insert({
userId,
type: 'list',
activityType: 'restoredList',
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,
});
}
});
}