Skip to content

Instantly share code, notes, and snippets.

@colinta
Created April 6, 2016 19:34
Show Gist options
  • Save colinta/11696023b0a9c812aa624083980c5a3c to your computer and use it in GitHub Desktop.
Save colinta/11696023b0a9c812aa624083980c5a3c to your computer and use it in GitHub Desktop.
diff --git a/src/reducers/json.js b/src/reducers/json.js
index 9ece66d..a89dff1 100644
--- a/src/reducers/json.js
+++ b/src/reducers/json.js
@@ -418,13 +418,12 @@ export default function json(state = {}, action = { type: '' }) {
keepers[collection] = action.payload.json[collection]
}
}
- return { ...state, ...keepers }
+ newState = { ...newState, ...keepers }
}
if (action.payload.profile) {
- methods.addModels(newState, MAPPING_TYPES.USERS, { users: action.payload.profile })
- return newState
+ methods.addModels(newState, MAPPING_TYPES.USERS, { users: [action.payload.profile] })
}
- return state
+ return newState
case LOCATION_CHANGE:
path = action.payload.pathname
if (action.payload.query.terms && prevTerms !== action.payload.query.terms) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment