1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00
planka/server/api/helpers/get-list-to-project-path.js
2019-08-31 04:07:25 +05:00

34 lines
539 B
JavaScript
Executable file

module.exports = {
inputs: {
criteria: {
type: 'json',
required: true
}
},
exits: {
notFound: {}
},
fn: async function(inputs, exits) {
const list = await List.findOne(inputs.criteria);
if (!list) {
throw 'notFound';
}
const path = await sails.helpers
.getBoardToProjectPath(list.boardId)
.intercept('notFound', path => ({
notFound: {
list,
...path
}
}));
return exits.success({
list,
...path
});
}
};