mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 13:19:44 +02:00
feat: Webhooks configuration, all events support, refactoring
This commit is contained in:
parent
193daf6cfb
commit
87683fe523
96 changed files with 1280 additions and 509 deletions
|
@ -29,18 +29,18 @@ module.exports = {
|
|||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
let { board } = await sails.helpers.boards
|
||||
const path = await sails.helpers.boards
|
||||
.getProjectPath(inputs.id)
|
||||
.intercept('pathNotFound', () => Errors.BOARD_NOT_FOUND);
|
||||
|
||||
let { board } = path;
|
||||
const { project } = path;
|
||||
|
||||
if (!board) {
|
||||
throw Errors.BOARD_NOT_FOUND;
|
||||
}
|
||||
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(
|
||||
currentUser.id,
|
||||
board.projectId,
|
||||
);
|
||||
const isProjectManager = await sails.helpers.users.isProjectManager(currentUser.id, project.id);
|
||||
|
||||
if (!isProjectManager) {
|
||||
throw Errors.BOARD_NOT_FOUND; // Forbidden
|
||||
|
@ -50,7 +50,9 @@ module.exports = {
|
|||
|
||||
board = await sails.helpers.boards.updateOne.with({
|
||||
values,
|
||||
project,
|
||||
record: board,
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue