mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
24 lines
508 B
JavaScript
24 lines
508 B
JavaScript
module.exports = {
|
|
inputs: {
|
|
criteria: {
|
|
type: 'json',
|
|
custom: value => _.isArray(value) || _.isPlainObject(value),
|
|
},
|
|
},
|
|
|
|
async fn(inputs, exits) {
|
|
const criteria = {
|
|
deletedAt: null,
|
|
};
|
|
|
|
if (_.isArray(inputs.criteria)) {
|
|
criteria.id = inputs.criteria;
|
|
} else if (_.isPlainObject(inputs.criteria)) {
|
|
Object.assign(criteria, inputs.criteria);
|
|
}
|
|
|
|
const users = await User.find(criteria).sort('id');
|
|
|
|
return exits.success(users);
|
|
},
|
|
};
|