mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
35 lines
549 B
JavaScript
35 lines
549 B
JavaScript
|
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
|
||
|
});
|
||
|
}
|
||
|
};
|