mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Fixing bug when adding users to redux.
This commit is contained in:
@@ -40,13 +40,15 @@ Promise.all([
|
||||
.then(res => Promise.all(res.map(handleResp)))
|
||||
.then(res => {
|
||||
res[2] = res[2].map(comment => { comment.flagged = true; return comment; });
|
||||
return res.reduce((prev, curr) => prev.concat(curr), []);
|
||||
res[0].comments = res[0].comments.concat(res[1]).concat(res[2]);
|
||||
return res[0];
|
||||
})
|
||||
.then(res => {
|
||||
store.dispatch({type: 'COMMENTS_MODERATION_QUEUE_FETCH_SUCCESS',
|
||||
comments: res.comments});
|
||||
console.log(res);
|
||||
store.dispatch({type: 'USERS_MODERATION_QUEUE_FETCH_SUCCESS',
|
||||
users: res.users});
|
||||
store.dispatch({type: 'COMMENTS_MODERATION_QUEUE_FETCH_SUCCESS',
|
||||
comments: res.comments});
|
||||
})
|
||||
.catch(error => store.dispatch({type: 'COMMENTS_MODERATION_QUEUE_FETCH_FAILED', error}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user