mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
34 lines
694 B
JavaScript
34 lines
694 B
JavaScript
module.exports = {
|
|
inputs: {
|
|
record: {
|
|
type: 'ref',
|
|
required: true,
|
|
},
|
|
request: {
|
|
type: 'ref',
|
|
},
|
|
},
|
|
|
|
async fn(inputs) {
|
|
const projectRelatedUserIds = await sails.helpers.projects.getManagerAndBoardMemberUserIds(
|
|
inputs.record.projectId,
|
|
);
|
|
|
|
const projectManager = await ProjectManager.destroyOne(inputs.record.id);
|
|
|
|
if (projectManager) {
|
|
projectRelatedUserIds.forEach((userId) => {
|
|
sails.sockets.broadcast(
|
|
`user:${userId}`,
|
|
'projectManagerDelete',
|
|
{
|
|
item: projectManager,
|
|
},
|
|
inputs.request,
|
|
);
|
|
});
|
|
}
|
|
|
|
return projectManager;
|
|
},
|
|
};
|