mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
dispatch update for adding comemnts
This commit is contained in:
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user