mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 09:13:21 +03:00
feat: Webhooks configuration, all events support, refactoring
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user