mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
34 lines
549 B
JavaScript
Executable file
34 lines
549 B
JavaScript
Executable file
module.exports = {
|
|
inputs: {
|
|
criteria: {
|
|
type: 'json',
|
|
required: true
|
|
}
|
|
},
|
|
|
|
exits: {
|
|
notFound: {}
|
|
},
|
|
|
|
fn: async function(inputs, exits) {
|
|
const action = await Action.findOne(inputs.criteria);
|
|
|
|
if (!action) {
|
|
throw 'notFound';
|
|
}
|
|
|
|
const path = await sails.helpers
|
|
.getCardToProjectPath(action.cardId)
|
|
.intercept('notFound', path => ({
|
|
notFound: {
|
|
action,
|
|
...path
|
|
}
|
|
}));
|
|
|
|
return exits.success({
|
|
action,
|
|
...path
|
|
});
|
|
}
|
|
};
|