mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01: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({
|
const check = Users.findOne({
|
||||||
_id: req.body.authorId,
|
_id: req.body.authorId,
|
||||||
});
|
});
|
||||||
const members = req.body.members || [req.body.authorId];
|
|
||||||
if (typeof check !== 'undefined') {
|
if (typeof check !== 'undefined') {
|
||||||
|
let members = req.body.members || [];
|
||||||
|
if (_.isString(members)) {
|
||||||
|
if (members === '') {
|
||||||
|
members = [];
|
||||||
|
} else {
|
||||||
|
members = [members];
|
||||||
|
}
|
||||||
|
}
|
||||||
const id = Cards.direct.insert({
|
const id = Cards.direct.insert({
|
||||||
title: req.body.title,
|
title: req.body.title,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue