mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 13:19:44 +02:00
30 lines
613 B
JavaScript
30 lines
613 B
JavaScript
|
module.exports = {
|
||
|
inputs: {
|
||
|
id: {
|
||
|
type: 'json',
|
||
|
custom: value => _.isInteger(value) || _.isArray(value),
|
||
|
required: true
|
||
|
},
|
||
|
exceptUserId: {
|
||
|
type: 'number',
|
||
|
custom: value => _.isInteger(value) || _.isArray(value)
|
||
|
}
|
||
|
},
|
||
|
|
||
|
fn: async function(inputs, exits) {
|
||
|
const criteria = {
|
||
|
cardId: inputs.id
|
||
|
};
|
||
|
|
||
|
if (!_.isUndefined(inputs.exceptUserId)) {
|
||
|
criteria.userId = {
|
||
|
'!=': inputs.exceptUserId
|
||
|
};
|
||
|
}
|
||
|
|
||
|
const cardMemberships = await sails.helpers.getCardMemberships(criteria);
|
||
|
|
||
|
return exits.success(cardMemberships);
|
||
|
}
|
||
|
};
|