mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
29 lines
609 B
JavaScript
29 lines
609 B
JavaScript
module.exports = {
|
|
inputs: {
|
|
id: {
|
|
type: 'json',
|
|
custom: value => _.isString(value) || _.isArray(value),
|
|
required: true
|
|
},
|
|
exceptUserId: {
|
|
type: 'json',
|
|
custom: value => _.isString(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);
|
|
}
|
|
};
|