You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
planka_custom/server/api/helpers/get-actions-for-card.js

31 lines
535 B
JavaScript

const LIMIT = 10;
module.exports = {
inputs: {
id: {
type: 'json',
custom: value => _.isInteger(value) || _.isArray(value),
required: true
},
beforeId: {
type: 'number'
}
},
fn: async function(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);
}
};