mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 21:29:43 +02:00
36 lines
504 B
JavaScript
36 lines
504 B
JavaScript
|
module.exports = {
|
||
|
inputs: {
|
||
|
criteria: {
|
||
|
type: 'json',
|
||
|
required: true
|
||
|
}
|
||
|
},
|
||
|
|
||
|
exits: {
|
||
|
notFound: {}
|
||
|
},
|
||
|
|
||
|
fn: async function(inputs, exits) {
|
||
|
const board = await Board.findOne(inputs.criteria);
|
||
|
|
||
|
if (!board) {
|
||
|
throw 'notFound';
|
||
|
}
|
||
|
|
||
|
const project = await Project.findOne(board.projectId);
|
||
|
|
||
|
if (!project) {
|
||
|
throw {
|
||
|
notFound: {
|
||
|
board
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
return exits.success({
|
||
|
board,
|
||
|
project
|
||
|
});
|
||
|
}
|
||
|
};
|