mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
REST API: fix handling of members property on card creation
This commit is contained in:
parent
4a42d683af
commit
ea90ce8784
1 changed files with 8 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue