浏览代码

POST /cards: allow setting card members

if members isn't specified then the authorId will be the only member of the card, otherwise the provided members attribute will be used
couscous3 7 年之前
父节点
当前提交
83e7e4fb27
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      models/cards.js

+ 2 - 1
models/cards.js

@@ -489,6 +489,7 @@ if (Meteor.isServer) {
     const paramBoardId = req.params.boardId;
     const paramListId = req.params.listId;
     const check = Users.findOne({_id: req.body.authorId});
+    const members = req.body.members || [req.body.authorId];
     if (typeof  check !== 'undefined') {
       const id = Cards.direct.insert({
         title: req.body.title,
@@ -498,7 +499,7 @@ if (Meteor.isServer) {
         userId: req.body.authorId,
         swimlaneId: req.body.swimlaneId,
         sort: 0,
-        members: [req.body.authorId],
+        members: members,
       });
       JsonRoutes.sendResult(res, {
         code: 200,