diff --git a/src/utils/query.js b/src/utils/query.js index 3c883816c..bebc56886 100644 --- a/src/utils/query.js +++ b/src/utils/query.js @@ -249,17 +249,19 @@ export function populateAndDispatch(firebase, dispatch, config) { // populatedDataToJS after all data is in redux (Issue #121) // TODO: Allow config to toggle Combining into one SET action // TODO: Set ordered for populate queries + let returnData = {} forEach(results, (result, path) => { dispatch({ type: actionTypes.MERGE, - path, + path: storeAs || path, data: result }) + returnData = { ...returnData, ...result } }) dispatch({ type: actionTypes.SET, path: storeAs || path, - data, + data: returnData, ordered: orderedFromSnapshot(snapshot) }) return results