1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-24 07:39:44 +02:00

Prepare for collection board type, refactoring, update dependencies

This commit is contained in:
Maksim Eltyshev 2020-08-04 01:32:46 +05:00
parent 2d92ade8dc
commit c6ee7d54bb
190 changed files with 2144 additions and 1817 deletions

View file

@ -11,6 +11,11 @@ module.exports = {
regex: /^[0-9]+$/,
required: true,
},
type: {
type: 'string',
isIn: Board.TYPES,
required: true,
},
position: {
type: 'number',
required: true,
@ -39,8 +44,7 @@ module.exports = {
throw Errors.PROJECT_NOT_FOUND;
}
const values = _.pick(inputs, ['position', 'name']);
const values = _.pick(inputs, ['type', 'position', 'name']);
const board = await sails.helpers.createBoard(project, values, this.req);
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed

View file

@ -40,10 +40,10 @@ module.exports = {
throw Errors.BOARD_NOT_FOUND; // Forbidden
}
const lists = await sails.helpers.getListsForBoard(board.id);
const labels = await sails.helpers.getLabelsForBoard(board.id);
const lists = await sails.helpers.getListsForBoard(board.id);
const cards = await sails.helpers.getCardsForBoard(board.id);
const cards = await sails.helpers.getCardsForBoard(board);
const cardIds = sails.helpers.mapRecords(cards);
const cardSubscriptions = await sails.helpers.getSubscriptionsByUserForCard(
@ -75,8 +75,8 @@ module.exports = {
return exits.success({
item: board,
included: {
lists,
labels,
lists,
cards,
cardMemberships,
cardLabels,

View file

@ -34,7 +34,6 @@ module.exports = {
}
const values = _.pick(inputs, ['position', 'name']);
board = await sails.helpers.updateBoard(board, values, this.req);
if (!board) {