The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wekan/server/lib/deleteActivities.js

43 lines
1.2 KiB

// Pure helpers that build the Activity document shape for "delete" events so the
// Activities.after.insert outgoing-webhook hook fires when a card or board is
// permanently removed (not just archived).
//
// These are intentionally side-effect free (no DB access) so they can be unit
// tested in isolation. The server remove hooks call them and pass the result to
// Activities.insertAsync().
//
// The shapes mirror the existing create/archive activities:
// - createCard / archivedCard: { userId, activityType, boardId, listId, cardId, swimlaneId, ... }
// - createBoard / removeBoard: { userId, type, activityType, activityTypeId, boardId }
export function buildDeleteCardActivity({
cardId,
boardId,
listId,
swimlaneId,
userId,
cardTitle,
} = {}) {
const activity = {
userId,
activityType: 'deleteCard',
boardId,
listId,
cardId,
swimlaneId,
};
if (cardTitle !== undefined) {
activity.cardTitle = cardTitle;
}
return activity;
}
export function buildDeleteBoardActivity({ boardId, userId } = {}) {
return {
userId,
type: 'board',
activityType: 'deleteBoard',
activityTypeId: boardId,
boardId,
};
}