diff options
author | Thomas Liske <thomas@fiasko-nw.net> | 2019-10-09 07:23:21 +0200 |
---|---|---|
committer | Thomas Liske <thomas@fiasko-nw.net> | 2019-10-09 07:23:21 +0200 |
commit | ea90ce87842f6dce06801fa2dc281d22ad9795b9 (patch) | |
tree | 84b45a3f7c85c458435048fd16e154ef0a4e7314 /models | |
parent | 4a42d683afacd6b54c4e76cd41a8a86585cf1e41 (diff) | |
download | wekan-ea90ce87842f6dce06801fa2dc281d22ad9795b9.tar.gz wekan-ea90ce87842f6dce06801fa2dc281d22ad9795b9.tar.bz2 wekan-ea90ce87842f6dce06801fa2dc281d22ad9795b9.zip |
REST API: fix handling of members property on card creation
Diffstat (limited to 'models')
-rw-r--r-- | models/cards.js | 9 |
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, |