From ae5bcf690087a210c1bbc4f41113019d217a0352 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Thu, 6 Apr 2017 18:15:02 -0300 Subject: [PATCH] getActionSummary exp --- client/coral-framework/utils/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/coral-framework/utils/index.js b/client/coral-framework/utils/index.js index 7c0767fe2..6d589cf23 100644 --- a/client/coral-framework/utils/index.js +++ b/client/coral-framework/utils/index.js @@ -1,2 +1,7 @@ -export const getActionSummary = (type, comment) => comment.action_summaries - .filter((a) => a.__typename === type)[0]; +/** +* getActionSummary +* retrieves the action summary based on the type and the comment +*/ + +export const getActionSummary = (type, comment) => + comment.action_summaries.filter(a => a.__typename === type)[0];