diff --git a/client/coral-framework/actions/user.js b/client/coral-framework/actions/user.js index 04d5c9238..0000acc5c 100644 --- a/client/coral-framework/actions/user.js +++ b/client/coral-framework/actions/user.js @@ -2,15 +2,15 @@ import * as actions from '../constants/user'; import {base, handleResp, getInit} from '../helpers/response'; const saveBioRequest = () => ({type: actions.SAVE_BIO_REQUEST}); -const saveBioSuccess = user => ({type: actions.SAVE_BIO_SUCCESS, user}); +const saveBioSuccess = settings => ({type: actions.SAVE_BIO_SUCCESS, settings}); const saveBioFailure = error => ({type: actions.SAVE_BIO_FAILURE, error}); export const saveBio = (user_id, formData) => dispatch => { dispatch(saveBioRequest()); - fetch(`${base}/${user_id}/bio`, getInit('POST', formData)) + fetch(`${base}/user/${user_id}/bio`, getInit('PUT', formData)) .then(handleResp) - .then(({user}) => { - dispatch(saveBioSuccess(user)); + .then(({settings}) => { + dispatch(saveBioSuccess(settings)); }) .catch(error => dispatch(saveBioFailure(error))); }; diff --git a/client/coral-framework/reducers/user.js b/client/coral-framework/reducers/user.js index 96307b293..f1d02a42c 100644 --- a/client/coral-framework/reducers/user.js +++ b/client/coral-framework/reducers/user.js @@ -4,8 +4,8 @@ import * as actions from '../constants/user'; const initialState = Map({ displayName: '', - profiles: [], - settings: [] + profiles: null, + settings: null }); const purge = user => { @@ -29,7 +29,7 @@ export default function user (state = initialState, action) { return initialState; case actions.SAVE_BIO_SUCCESS: return state - .set('bio', action.user.bio); + .set('settings', action.settings); default : return state; } diff --git a/client/coral-settings/components/Bio.js b/client/coral-settings/components/Bio.js index 36c3855df..c142ee5bc 100644 --- a/client/coral-settings/components/Bio.js +++ b/client/coral-settings/components/Bio.js @@ -2,15 +2,17 @@ import React from 'react'; import styles from './Bio.css'; import {Button} from '../../coral-ui'; -export default ({userData, bio, handleSave, handleChange}) => ( +export default ({bio, handleSave, handleInput}) => (

Bio

Tell the community about yourself

-