You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
501 B
JavaScript
36 lines
501 B
JavaScript
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,
|
|
});
|
|
},
|
|
};
|