summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-10-09 13:56:11 +0300
committerGitHub <noreply@github.com>2019-10-09 13:56:11 +0300
commit6feb35c07924d6dc96a45e58eba45a808eb9fcf3 (patch)
tree84b45a3f7c85c458435048fd16e154ef0a4e7314
parent4a42d683afacd6b54c4e76cd41a8a86585cf1e41 (diff)
parentea90ce87842f6dce06801fa2dc281d22ad9795b9 (diff)
downloadwekan-6feb35c07924d6dc96a45e58eba45a808eb9fcf3.tar.gz
wekan-6feb35c07924d6dc96a45e58eba45a808eb9fcf3.tar.bz2
wekan-6feb35c07924d6dc96a45e58eba45a808eb9fcf3.zip
Merge pull request #2751 from liske/fixes/rest-card-members
REST API: fix handling of members property on card creation
-rw-r--r--models/cards.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/models/cards.js b/models/cards.js
index 371ad185..635a4e72 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -1852,8 +1852,15 @@ if (Meteor.isServer) {
const check = Users.findOne({
_id: req.body.authorId,
});
- const members = req.body.members || [req.body.authorId];
if (typeof check !== 'undefined') {
+ let members = req.body.members || [];
+ if (_.isString(members)) {
+ if (members === '') {
+ members = [];
+ } else {
+ members = [members];
+ }
+ }
const id = Cards.direct.insert({
title: req.body.title,
boardId: paramBoardId,