You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
533 B
JavaScript
34 lines
533 B
JavaScript
module.exports = {
|
|
inputs: {
|
|
card: {
|
|
type: 'ref',
|
|
required: true
|
|
},
|
|
values: {
|
|
type: 'json',
|
|
required: true
|
|
},
|
|
request: {
|
|
type: 'ref'
|
|
}
|
|
},
|
|
|
|
fn: async function(inputs, exits) {
|
|
const task = await Task.create({
|
|
...inputs.values,
|
|
cardId: inputs.card.id
|
|
}).fetch();
|
|
|
|
sails.sockets.broadcast(
|
|
`board:${inputs.card.boardId}`,
|
|
'taskCreate',
|
|
{
|
|
item: task
|
|
},
|
|
inputs.request
|
|
);
|
|
|
|
return exits.success(task);
|
|
}
|
|
};
|