mirror of
https://github.com/wassname/talk.git
synced 2026-08-14 12:50:17 +08:00
use new coralApi fetch
This commit is contained in:
@@ -92,8 +92,7 @@ export const appendItemArray = (id, property, value, add_to_front, item_type) =>
|
||||
export const fetchCommentsByUserId = userId => {
|
||||
return (dispatch) => {
|
||||
dispatch({type: REQUEST_COMMENTS_BY_USER});
|
||||
return fetch(`/api/v1/comments?user_id=${userId}`, getInit('GET'))
|
||||
.then(responseHandler)
|
||||
return coralApi(`/comments?user_id=${userId}`)
|
||||
.then(comments => {
|
||||
dispatch({type: RECEIVE_COMMENTS_BY_USER, comments});
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ class SignInContainer extends Component {
|
||||
|
||||
componentWillMount () {
|
||||
// Fetch commentHistory
|
||||
console.log('userData', this.props.userData);
|
||||
this.props.fetchCommentsByUserId(this.props.userData.id);
|
||||
}
|
||||
|
||||
handleTabChange(tab) {
|
||||
|
||||
Reference in New Issue
Block a user