瀏覽代碼

Updated insert action for CustomFields API

James Byrne 5 年之前
父節點
當前提交
851246a59b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      models/customFields.js

+ 2 - 1
models/customFields.js

@@ -302,6 +302,7 @@ if (Meteor.isServer) {
   ) {
     Authentication.checkUserId(req.userId);
     const paramBoardId = req.params.boardId;
+    const board = Boards.findOne({ _id: paramBoardId });
     const id = CustomFields.direct.insert({
       name: req.body.name,
       type: req.body.type,
@@ -309,7 +310,7 @@ if (Meteor.isServer) {
       showOnCard: req.body.showOnCard,
       automaticallyOnCard: req.body.automaticallyOnCard,
       showLabelOnMiniCard: req.body.showLabelOnMiniCard,
-      boardIds: { $in: [paramBoardId] },
+      boardIds: [board._id],
     });
 
     const customField = CustomFields.findOne({