mirror of
https://github.com/plankanban/planka.git
synced 2025-12-16 09:13:18 +03:00
Fix loading deleted users on actions fetch. Closes #62
This commit is contained in:
@@ -4,12 +4,14 @@ module.exports = {
|
||||
type: 'json',
|
||||
custom: (value) => _.isArray(value) || _.isPlainObject(value),
|
||||
},
|
||||
withDeleted: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs, exits) {
|
||||
const criteria = {
|
||||
deletedAt: null,
|
||||
};
|
||||
const criteria = {};
|
||||
|
||||
if (_.isArray(inputs.criteria)) {
|
||||
criteria.id = inputs.criteria;
|
||||
@@ -17,6 +19,10 @@ module.exports = {
|
||||
Object.assign(criteria, inputs.criteria);
|
||||
}
|
||||
|
||||
if (!inputs.withDeleted) {
|
||||
criteria.deletedAt = null;
|
||||
}
|
||||
|
||||
const users = await User.find(criteria).sort('id');
|
||||
|
||||
return exits.success(users);
|
||||
|
||||
Reference in New Issue
Block a user