From 880384cf866482f2d224e6558ff0da3095115a84 Mon Sep 17 00:00:00 2001 From: sonimehul Date: Wed, 24 Jun 2015 18:08:14 -0400 Subject: [PATCH] Change labels for Reactions API --- common/models/event.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/models/event.js b/common/models/event.js index d0f8fbf..933732d 100644 --- a/common/models/event.js +++ b/common/models/event.js @@ -541,8 +541,20 @@ processReactionsResponse = function (error, response, body, cb) { retResults = results; } } + + var finalResults = []; + if(retResults) { + for(var i=0; i < retResults.length; i++) { + var obj = {}; + obj.label = retResults[i].term; + obj.value = retResults[i].count; + + finalResults.push(obj); + + } + } } - return cb(null, retResults); + return cb(null, finalResults); }; }; \ No newline at end of file