Commit f8d59854 authored by Paul Kaplan's avatar Paul Kaplan

Update instead of replacing project info to match API.

The API endpoint will return just the updated slice of the projectInfo, so just update the projectInfo instead of replacing.
parent 3a03f10a
......@@ -55,6 +55,10 @@ module.exports.previewReducer = (state, action) => {
projectInfo: action.info ? action.info : {},
projectNotAvailable: !action.info
});
case 'UPDATE_PROJECT_INFO':
return Object.assign({}, state, {
projectInfo: Object.assign({}, state.projectInfo, action.info)
});
case 'SET_REMIXES':
return Object.assign({}, state, {
remixes: action.items
......@@ -182,6 +186,11 @@ module.exports.setProjectInfo = info => ({
info: info
});
module.exports.updateProjectInfo = info => ({
type: 'UPDATE_PROJECT_INFO',
info: info
});
module.exports.setOriginalInfo = info => ({
type: 'SET_ORIGINAL',
info: info
......@@ -785,7 +794,7 @@ module.exports.shareProject = (projectId, token) => (dispatch => {
return;
}
dispatch(module.exports.setFetchStatus('project', module.exports.Status.FETCHED));
dispatch(module.exports.setProjectInfo(body));
dispatch(module.exports.updateProjectInfo(body));
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment