diff --git a/models/action.js b/models/action.js index 043699988..cc310c5a8 100644 --- a/models/action.js +++ b/models/action.js @@ -47,9 +47,10 @@ ActionSchema.statics.getActionSummaries = function(item_ids) { const actionSummaries = rawActions.reduce((actionObj, action) => { if (!actionObj[action.item_id]) { actionObj[action.item_id] = { + id: action.id, type: action.action_type, count: 1, - current_user: false //Corrent this later when we have authentication + current_user: false //Update this later when we have authentication }; } else { actionObj[action.item_id].count ++; diff --git a/routes/api/stream/index.js b/routes/api/stream/index.js index 8a51fc75d..8908b27eb 100644 --- a/routes/api/stream/index.js +++ b/routes/api/stream/index.js @@ -17,7 +17,11 @@ router.get('/', (req, res, next) => { Action.getActionSummaries(comments.map((comment) => comment.id)) ]); }).then(([comments, users, actions]) => { - res.json([...comments, ...users, ...actions]); + res.json({ + comments, + users, + actions + }); }).catch(error => { next(error); });