summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2018-07-02 18:34:46 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2018-10-23 18:48:01 +0200
commit53c8e63a09b513a37d308d2301b2925e239dabfe (patch)
treed68099448f3330bd1290276fb90f43c629e339c8 /models
parent9aa5584c9c7a5bf7d9755dd266a0b0035f57ebf0 (diff)
downloadwekan-53c8e63a09b513a37d308d2301b2925e239dabfe.tar.gz
wekan-53c8e63a09b513a37d308d2301b2925e239dabfe.tar.bz2
wekan-53c8e63a09b513a37d308d2301b2925e239dabfe.zip
models: customFields: fix GET api
Calling GET on /api/board/XXXX/customfields returns a 500 error: TypeError: Converting circular structure to JSON
Diffstat (limited to 'models')
-rw-r--r--models/customFields.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/models/customFields.js b/models/customFields.js
index 38481d8c..203e46d0 100644
--- a/models/customFields.js
+++ b/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,
+ };
+ }),
});
});