dispatch update for adding comemnts

This commit is contained in:
Riley Davis
2016-11-28 10:54:10 -07:00
parent 28520bfd4a
commit d10870c6bb
+5
View File
@@ -104,6 +104,11 @@ export const fetchCommentsByUserId = userId => {
.then(responseHandler)
.then(comments => {
dispatch({type: RECEIVE_COMMENTS_BY_USER, comments});
comments.forEach(comment => {
dispatch(addItem(comment, 'comments'));
});
})
.catch(error => {
dispatch({type: FAILURE_COMMENTS_BY_USER, error});