浏览代码

- REST API: Create board options to be modifiable, like
permissions, public/private board - now private by default,
and board background color.
Docs at https://github.com/wekan/wekan/wiki/REST-API-Boards

Thanks to xet7 !

Related #1037

Lauri Ojansivu 6 年之前
父节点
当前提交
9cea76e4ef
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      models/boards.js

+ 6 - 6
models/boards.js

@@ -846,14 +846,14 @@ if (Meteor.isServer) {
         members: [
           {
             userId: req.body.owner,
-            isAdmin: true,
-            isActive: true,
-            isNoComments: false,
-            isCommentOnly: false,
+            isAdmin: req.body.isAdmin || true,
+            isActive: req.body.isActive || true,
+            isNoComments: req.body.isNoComments || false,
+            isCommentOnly: req.body.isCommentOnly || false,
           },
         ],
-        permission: 'public',
-        color: 'belize',
+        permission: req.body.permission || 'private',
+        color: req.body.color || 'belize',
       });
       JsonRoutes.sendResult(res, {
         code: 200,