mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
34 lines
554 B
JavaScript
Executable file
34 lines
554 B
JavaScript
Executable file
module.exports = {
|
|
inputs: {
|
|
criteria: {
|
|
type: 'json',
|
|
required: true,
|
|
},
|
|
},
|
|
|
|
exits: {
|
|
pathNotFound: {},
|
|
},
|
|
|
|
async fn(inputs, exits) {
|
|
const card = await Card.findOne(inputs.criteria);
|
|
|
|
if (!card) {
|
|
throw 'pathNotFound';
|
|
}
|
|
|
|
const path = await sails.helpers
|
|
.getListToProjectPath(card.listId)
|
|
.intercept('pathNotFound', (nodes) => ({
|
|
pathNotFound: {
|
|
card,
|
|
...nodes,
|
|
},
|
|
}));
|
|
|
|
return exits.success({
|
|
card,
|
|
...path,
|
|
});
|
|
},
|
|
};
|