mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Add file attachments
This commit is contained in:
parent
202abacaec
commit
6a68ec9c1e
103 changed files with 1847 additions and 305 deletions
33
server/api/helpers/create-attachment.js
Normal file
33
server/api/helpers/create-attachment.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
module.exports = {
|
||||
inputs: {
|
||||
card: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
values: {
|
||||
type: 'json',
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
const attachment = await Attachment.create({
|
||||
...inputs.values,
|
||||
cardId: inputs.card.id,
|
||||
}).fetch();
|
||||
|
||||
sails.sockets.broadcast(
|
||||
`board:${inputs.card.boardId}`,
|
||||
'attachmentCreate',
|
||||
{
|
||||
item: attachment,
|
||||
},
|
||||
inputs.request,
|
||||
);
|
||||
|
||||
return exits.success(attachment);
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue