mirror of
https://github.com/plankanban/planka.git
synced 2025-07-23 07:09:44 +02:00
feat: Webhooks configuration, all events support, refactoring
This commit is contained in:
parent
3779bdb053
commit
c065566c15
96 changed files with 1280 additions and 509 deletions
|
@ -48,14 +48,11 @@ module.exports = {
|
|||
async fn(inputs) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const { board } = await sails.helpers.boards
|
||||
const { board, project } = await sails.helpers.boards
|
||||
.getProjectPath(inputs.boardId)
|
||||
.intercept('pathNotFound', () => 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
|
||||
|
@ -71,11 +68,13 @@ module.exports = {
|
|||
|
||||
const boardMembership = await sails.helpers.boardMemberships.createOne
|
||||
.with({
|
||||
project,
|
||||
values: {
|
||||
...values,
|
||||
board,
|
||||
user,
|
||||
},
|
||||
actorUser: currentUser,
|
||||
request: this.req,
|
||||
})
|
||||
.intercept('userAlreadyBoardMember', () => Errors.USER_ALREADY_BOARD_MEMBER);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue