mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 17:23:21 +03:00
Project managers, board members, auto-update after reconnection, refactoring
This commit is contained in:
27
server/api/helpers/projects/get-boards.js
Normal file
27
server/api/helpers/projects/get-boards.js
Normal file
@@ -0,0 +1,27 @@
|
||||
module.exports = {
|
||||
inputs: {
|
||||
idOrIds: {
|
||||
type: 'json',
|
||||
custom: (value) => _.isString(value) || _.every(value, _.isString),
|
||||
required: true,
|
||||
},
|
||||
exceptBoardIdOrIds: {
|
||||
type: 'json',
|
||||
custom: (value) => _.isString(value) || _.every(value, _.isString),
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
const criteria = {
|
||||
projectId: inputs.idOrIds,
|
||||
};
|
||||
|
||||
if (!_.isUndefined(inputs.exceptBoardIdOrIds)) {
|
||||
criteria.id = {
|
||||
'!=': inputs.exceptBoardIdOrIds,
|
||||
};
|
||||
}
|
||||
|
||||
return sails.helpers.boards.getMany(criteria);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user