use new coralApi fetch

This commit is contained in:
Riley Davis
2016-12-12 12:28:10 -07:00
parent c9a8d448ba
commit c999e1c1a9
2 changed files with 3 additions and 2 deletions
+1 -2
View File
@@ -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) {