mirror of
https://github.com/plankanban/planka.git
synced 2025-07-20 21:59:43 +02:00
Code formatting with prettier, change eslint config for the server
This commit is contained in:
parent
b7f37f0f96
commit
a11f6260c0
191 changed files with 4321 additions and 2880 deletions
|
@ -2,43 +2,43 @@ module.exports = {
|
|||
inputs: {
|
||||
list: {
|
||||
type: 'ref',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
values: {
|
||||
type: 'json',
|
||||
custom: value => _.isPlainObject(value) && _.isFinite(value.position),
|
||||
required: true
|
||||
custom: (value) => _.isPlainObject(value) && _.isFinite(value.position),
|
||||
required: true,
|
||||
},
|
||||
user: {
|
||||
type: 'ref',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
request: {
|
||||
type: 'ref'
|
||||
}
|
||||
type: 'ref',
|
||||
},
|
||||
},
|
||||
|
||||
fn: async function(inputs, exits) {
|
||||
async fn(inputs, exits) {
|
||||
const cards = await sails.helpers.getCardsForList(inputs.list.id);
|
||||
|
||||
const { position, repositions } = sails.helpers.insertToPositionables(
|
||||
inputs.values.position,
|
||||
cards
|
||||
cards,
|
||||
);
|
||||
|
||||
repositions.forEach(async ({ id, position }) => {
|
||||
repositions.forEach(async ({ id, position: nextPosition }) => {
|
||||
await Card.update({
|
||||
id,
|
||||
listId: inputs.list.id
|
||||
listId: inputs.list.id,
|
||||
}).set({
|
||||
position
|
||||
position: nextPosition,
|
||||
});
|
||||
|
||||
sails.sockets.broadcast(`board:${list.boardId}`, 'cardUpdate', {
|
||||
item: {
|
||||
id,
|
||||
position
|
||||
}
|
||||
position: nextPosition,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -46,27 +46,27 @@ module.exports = {
|
|||
...inputs.values,
|
||||
position,
|
||||
listId: inputs.list.id,
|
||||
boardId: inputs.list.boardId
|
||||
boardId: inputs.list.boardId,
|
||||
}).fetch();
|
||||
|
||||
sails.sockets.broadcast(
|
||||
`board:${card.boardId}`,
|
||||
'cardCreate',
|
||||
{
|
||||
item: card
|
||||
item: card,
|
||||
},
|
||||
inputs.request
|
||||
inputs.request,
|
||||
);
|
||||
|
||||
const values = {
|
||||
type: 'createCard',
|
||||
data: {
|
||||
list: _.pick(inputs.list, ['id', 'name'])
|
||||
}
|
||||
list: _.pick(inputs.list, ['id', 'name']),
|
||||
},
|
||||
};
|
||||
|
||||
await sails.helpers.createAction(card, inputs.user, values);
|
||||
|
||||
return exits.success(card);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue