mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
30 lines
532 B
JavaScript
30 lines
532 B
JavaScript
const LIMIT = 10;
|
|
|
|
module.exports = {
|
|
inputs: {
|
|
id: {
|
|
type: 'json',
|
|
custom: (value) => _.isString(value) || _.isArray(value),
|
|
required: true,
|
|
},
|
|
beforeId: {
|
|
type: 'string',
|
|
},
|
|
},
|
|
|
|
async fn(inputs, exits) {
|
|
const criteria = {
|
|
cardId: inputs.id,
|
|
};
|
|
|
|
if (!_.isUndefined(inputs.beforeId)) {
|
|
criteria.id = {
|
|
'<': inputs.beforeId,
|
|
};
|
|
}
|
|
|
|
const actions = await sails.helpers.getActions(criteria, LIMIT);
|
|
|
|
return exits.success(actions);
|
|
},
|
|
};
|