summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorcouscous3 <33840325+couscous3@users.noreply.github.com>2018-05-03 00:35:47 +0200
committerGitHub <noreply@github.com>2018-05-03 00:35:47 +0200
commit83e7e4fb271f52b38b70562410a55d89354269da (patch)
tree39bfbf58d415d41bcd226ebfefe09ec0d5da7668 /models
parentd77e54fff6dd351c2295cde019946fa74e489507 (diff)
downloadwekan-83e7e4fb271f52b38b70562410a55d89354269da.tar.gz
wekan-83e7e4fb271f52b38b70562410a55d89354269da.tar.bz2
wekan-83e7e4fb271f52b38b70562410a55d89354269da.zip
POST /cards: allow setting card members
if members isn't specified then the authorId will be the only member of the card, otherwise the provided members attribute will be used
Diffstat (limited to 'models')
-rw-r--r--models/cards.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/cards.js b/models/cards.js
index 4a662953..721e1ee7 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -489,6 +489,7 @@ if (Meteor.isServer) {
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
const check = Users.findOne({_id: req.body.authorId});
+ const members = req.body.members || [req.body.authorId];
if (typeof check !== 'undefined') {
const id = Cards.direct.insert({
title: req.body.title,
@@ -498,7 +499,7 @@ if (Meteor.isServer) {
userId: req.body.authorId,
swimlaneId: req.body.swimlaneId,
sort: 0,
- members: [req.body.authorId],
+ members: members,
});
JsonRoutes.sendResult(res, {
code: 200,