2025-05-10 02:09:06 +02:00
|
|
|
/*!
|
|
|
|
* Copyright (c) 2024 PLANKA Software GmbH
|
|
|
|
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
|
|
*/
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
module.exports = {
|
|
|
|
inputs: {
|
2025-05-10 02:09:06 +02:00
|
|
|
id: {
|
|
|
|
type: 'string',
|
2019-11-05 18:01:42 +05:00
|
|
|
required: true,
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
|
|
|
|
exits: {
|
2020-04-03 00:35:25 +05:00
|
|
|
pathNotFound: {},
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
async fn(inputs) {
|
2025-05-10 02:09:06 +02:00
|
|
|
const board = await Board.qm.getOneById(inputs.id);
|
2019-08-31 04:07:25 +05:00
|
|
|
|
|
|
|
if (!board) {
|
2020-04-03 00:35:25 +05:00
|
|
|
throw 'pathNotFound';
|
2019-08-31 04:07:25 +05:00
|
|
|
}
|
|
|
|
|
2025-05-10 02:09:06 +02:00
|
|
|
const project = await Project.qm.getOneById(board.projectId);
|
2019-08-31 04:07:25 +05:00
|
|
|
|
|
|
|
if (!project) {
|
|
|
|
throw {
|
2020-04-03 00:35:25 +05:00
|
|
|
pathNotFound: {
|
2019-11-05 18:01:42 +05:00
|
|
|
board,
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
return {
|
2019-08-31 04:07:25 +05:00
|
|
|
board,
|
2019-11-05 18:01:42 +05:00
|
|
|
project,
|
2021-06-24 01:05:22 +05:00
|
|
|
};
|
2019-11-05 18:01:42 +05:00
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
};
|