فهرست منبع

models: customFields: fix GET api

Calling GET on /api/board/XXXX/customfields
returns a 500 error:

 TypeError: Converting circular structure to JSON
Benjamin Tissoires 7 سال پیش
والد
کامیت
53c8e63a09
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      models/customFields.js

+ 7 - 1
models/customFields.js

@@ -87,7 +87,13 @@ if (Meteor.isServer) {
     const paramBoardId = req.params.boardId;
     JsonRoutes.sendResult(res, {
       code: 200,
-      data: CustomFields.find({ boardId: paramBoardId }),
+      data: CustomFields.find({ boardId: paramBoardId }).map(function (cf) {
+        return {
+          _id: cf._id,
+          name: cf.name,
+          type: cf.type,
+        };
+      }),
     });
   });