mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 07:39:44 +02:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
parent
7956503a46
commit
fe91b5241e
478 changed files with 21226 additions and 19495 deletions
|
@ -1,43 +0,0 @@
|
|||
const LIMIT = 10;
|
||||
|
||||
module.exports = {
|
||||
inputs: {
|
||||
recordOrId: {
|
||||
type: 'ref',
|
||||
custom: (value) => _.isObjectLike(value) || _.isString(value) || _.every(value, _.isString),
|
||||
required: true,
|
||||
},
|
||||
beforeId: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
const criteria = {};
|
||||
|
||||
let sort;
|
||||
let limit;
|
||||
|
||||
if (_.isObjectLike(inputs.recordOrId)) {
|
||||
criteria.boardId = inputs.recordOrId.id;
|
||||
|
||||
if (inputs.recordOrId.type === 'kanban') {
|
||||
sort = 'position';
|
||||
} else if (inputs.recordOrId.type === 'collection') {
|
||||
if (inputs.beforeId) {
|
||||
criteria.id = {
|
||||
'<': inputs.beforeId,
|
||||
};
|
||||
}
|
||||
|
||||
limit = LIMIT;
|
||||
}
|
||||
} else {
|
||||
criteria.boardId = inputs.recordOrId;
|
||||
}
|
||||
|
||||
const cards = await sails.helpers.getCards(criteria, sort, limit);
|
||||
|
||||
return exits.success(cards);
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue