mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
35 lines
491 B
JavaScript
35 lines
491 B
JavaScript
module.exports = {
|
|
inputs: {
|
|
criteria: {
|
|
type: 'json',
|
|
required: true,
|
|
},
|
|
},
|
|
|
|
exits: {
|
|
pathNotFound: {},
|
|
},
|
|
|
|
async fn(inputs) {
|
|
const board = await Board.findOne(inputs.criteria);
|
|
|
|
if (!board) {
|
|
throw 'pathNotFound';
|
|
}
|
|
|
|
const project = await Project.findOne(board.projectId);
|
|
|
|
if (!project) {
|
|
throw {
|
|
pathNotFound: {
|
|
board,
|
|
},
|
|
};
|
|
}
|
|
|
|
return {
|
|
board,
|
|
project,
|
|
};
|
|
},
|
|
};
|