2022-12-26 21:10:50 +01:00
|
|
|
const idOrIdsValidator = (value) => _.isString(value) || _.every(value, _.isString);
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
module.exports = {
|
|
|
|
inputs: {
|
|
|
|
idOrIds: {
|
|
|
|
type: 'json',
|
2022-12-26 21:10:50 +01:00
|
|
|
custom: idOrIdsValidator,
|
2021-06-24 01:05:22 +05:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
async fn(inputs) {
|
2022-12-26 21:10:50 +01:00
|
|
|
const projectManagerUserIds = await sails.helpers.projects.getManagerUserIds(inputs.idOrIds);
|
|
|
|
const boardMemberUserIds = await sails.helpers.projects.getBoardMemberUserIds(inputs.idOrIds);
|
2021-06-24 01:05:22 +05:00
|
|
|
|
2022-12-26 21:10:50 +01:00
|
|
|
return _.union(projectManagerUserIds, boardMemberUserIds);
|
2021-06-24 01:05:22 +05:00
|
|
|
},
|
|
|
|
};
|