feat: Toggle actions details, little redesign
This commit is contained in:
@@ -15,6 +15,9 @@ module.exports = {
|
||||
type: 'string',
|
||||
regex: /^[0-9]+$/,
|
||||
},
|
||||
withDetails: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
|
||||
exits: {
|
||||
@@ -43,7 +46,11 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
const actions = await sails.helpers.cards.getActions(card.id, inputs.beforeId);
|
||||
const actions = await sails.helpers.cards.getActions(
|
||||
card.id,
|
||||
inputs.beforeId,
|
||||
inputs.withDetails,
|
||||
);
|
||||
|
||||
const userIds = sails.helpers.utils.mapRecords(actions, 'userId', true);
|
||||
const users = await sails.helpers.users.getMany(userIds, true);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const LIMIT = 10;
|
||||
const LIMIT = 50;
|
||||
|
||||
module.exports = {
|
||||
inputs: {
|
||||
@@ -10,6 +10,10 @@ module.exports = {
|
||||
beforeId: {
|
||||
type: 'string',
|
||||
},
|
||||
withDetails: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
@@ -23,6 +27,10 @@ module.exports = {
|
||||
};
|
||||
}
|
||||
|
||||
if (!inputs.withDetails) {
|
||||
criteria.type = Action.Types.COMMENT_CARD;
|
||||
}
|
||||
|
||||
return sails.helpers.actions.getMany(criteria, LIMIT);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user