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