mirror of
https://github.com/plankanban/planka.git
synced 2025-12-19 17:23:27 +03:00
feat: Log actions when task completion status changes
This commit is contained in:
@@ -132,6 +132,22 @@ module.exports = {
|
||||
}),
|
||||
user: inputs.actorUser,
|
||||
});
|
||||
|
||||
if (inputs.record.isCompleted !== task.isCompleted) {
|
||||
await sails.helpers.actions.createOne.with({
|
||||
values: {
|
||||
type: task.isCompleted ? Action.Types.COMPLETE_TASK : Action.Types.UNCOMPLETE_TASK,
|
||||
data: {
|
||||
task: _.pick(task, ['id', 'name']),
|
||||
},
|
||||
user: inputs.actorUser,
|
||||
card: inputs.card,
|
||||
},
|
||||
project: inputs.project,
|
||||
board: inputs.board,
|
||||
list: inputs.list,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return task;
|
||||
|
||||
Reference in New Issue
Block a user