mirror of
https://github.com/plankanban/planka.git
synced 2025-07-20 13:49:43 +02:00
parent
d80a538857
commit
51fa7df69c
61 changed files with 1063 additions and 191 deletions
|
@ -1,5 +1,9 @@
|
|||
module.exports = {
|
||||
inputs: {
|
||||
values: {
|
||||
type: 'json',
|
||||
required: true,
|
||||
},
|
||||
user: {
|
||||
type: 'ref',
|
||||
required: true,
|
||||
|
@ -18,7 +22,16 @@ module.exports = {
|
|||
},
|
||||
|
||||
async fn(inputs) {
|
||||
if (inputs.values.role === BoardMembership.Roles.EDITOR) {
|
||||
delete inputs.values.canComment; // eslint-disable-line no-param-reassign
|
||||
} else if (inputs.values.role === BoardMembership.Roles.VIEWER) {
|
||||
if (_.isNil(inputs.values.canComment)) {
|
||||
inputs.values.canComment = false; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
}
|
||||
|
||||
const boardMembership = await BoardMembership.create({
|
||||
...inputs.values,
|
||||
boardId: inputs.board.id,
|
||||
userId: inputs.user.id,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue