mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 13:19:44 +02:00
35 lines
501 B
JavaScript
Executable file
35 lines
501 B
JavaScript
Executable file
module.exports = {
|
|
inputs: {
|
|
criteria: {
|
|
type: 'json',
|
|
required: true,
|
|
},
|
|
},
|
|
|
|
exits: {
|
|
notFound: {},
|
|
},
|
|
|
|
async fn(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,
|
|
});
|
|
},
|
|
};
|