From 1312256673f03245fb4c9cb88ae83d74a177c246 Mon Sep 17 00:00:00 2001 From: Sulka Haro Date: Mon, 16 Dec 2019 19:22:26 +0200 Subject: [PATCH] Unbreak JSON serialization failing on the /properties API due to circular data reference --- lib/plugins/cob.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/cob.js b/lib/plugins/cob.js index 198780c2926..c6d4c4fdf8f 100644 --- a/lib/plugins/cob.js +++ b/lib/plugins/cob.js @@ -49,9 +49,9 @@ function init (ctx) { var treatmentCOB = (treatments !== undefined && treatments.length) ? cob.fromTreatments(treatments, devicestatus, profile, time, spec_profile) : {}; - result = treatmentCOB; + result = _.cloneDeep(treatmentCOB); result.source = 'Care Portal'; - result.treatmentCOB = treatmentCOB; + result.treatmentCOB = _.cloneDeep(treatmentCOB); } return addDisplay(result);