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.
planka_custom/server/api/helpers/get-list-to-project-path.js

35 lines
539 B
JavaScript

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
});
}
};