mirror of
https://github.com/plankanban/planka.git
synced 2025-07-23 07:09:44 +02:00
parent
d80a538857
commit
51fa7df69c
61 changed files with 1063 additions and 191 deletions
|
@ -22,6 +22,14 @@ module.exports = {
|
|||
regex: /^[0-9]+$/,
|
||||
required: true,
|
||||
},
|
||||
role: {
|
||||
type: 'string',
|
||||
isIn: Object.values(BoardMembership.Roles),
|
||||
required: true,
|
||||
},
|
||||
canComment: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
|
||||
exits: {
|
||||
|
@ -58,8 +66,10 @@ module.exports = {
|
|||
throw Error.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
const values = _.pick(inputs, ['role', 'canComment']);
|
||||
|
||||
const boardMembership = await sails.helpers.boardMemberships
|
||||
.createOne(user, board, this.req)
|
||||
.createOne(values, user, board, this.req)
|
||||
.intercept('userAlreadyBoardMember', () => Errors.USER_ALREADY_BOARD_MEMBER);
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue