REST API: fix handling of members property on card creation

This commit is contained in:
Thomas Liske 2019-10-09 07:23:21 +02:00
parent 4a42d683af
commit ea90ce8784

View file

@ -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,