mirror of
https://github.com/plankanban/planka.git
synced 2025-07-20 13:49:43 +02:00
parent
9ce8b2ab9c
commit
738ed19e7f
20 changed files with 537 additions and 89 deletions
|
@ -5,6 +5,13 @@ module.exports = {
|
|||
custom: (value) => _.isPlainObject(value) && _.isFinite(value.position),
|
||||
required: true,
|
||||
},
|
||||
import: {
|
||||
type: 'json',
|
||||
custom: (value) =>
|
||||
value.type &&
|
||||
Object.values(Board.ImportTypes).includes(value.type) &&
|
||||
_.isPlainObject(value.board),
|
||||
},
|
||||
user: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
|
@ -13,6 +20,10 @@ module.exports = {
|
|||
type: 'ref',
|
||||
required: true,
|
||||
},
|
||||
requestId: {
|
||||
type: 'string',
|
||||
isNotEmptyString: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref',
|
||||
},
|
||||
|
@ -54,6 +65,10 @@ module.exports = {
|
|||
projectId: inputs.project.id,
|
||||
}).fetch();
|
||||
|
||||
if (inputs.import && inputs.import.type === Board.ImportTypes.TRELLO) {
|
||||
await sails.helpers.boards.importFromTrello(inputs.user, board, inputs.import.board);
|
||||
}
|
||||
|
||||
const boardMembership = await BoardMembership.create({
|
||||
boardId: board.id,
|
||||
userId: inputs.user.id,
|
||||
|
@ -66,6 +81,7 @@ module.exports = {
|
|||
'boardCreate',
|
||||
{
|
||||
item: board,
|
||||
requestId: inputs.requestId,
|
||||
},
|
||||
inputs.request,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue