changes ChangeUsername

This commit is contained in:
Belen Curcio
2017-11-22 00:53:01 -03:00
parent 90daab8219
commit f19d6b6800
2 changed files with 4 additions and 3 deletions
@@ -92,12 +92,13 @@ class ChangeUsernameContainer extends React.Component {
handleSubmitUsername = (e) => {
e.preventDefault();
const {errors, formData: {username}} = this.state;
const {validForm, invalidForm} = this.props;
const {validForm, invalidForm, hideCreateUsernameDialog, changeUsername} = this.props;
this.displayErrors();
if (this.isCompleted() && !Object.keys(errors).length) {
this.props.changeUsername(this.props.auth.user.id, username);
changeUsername(this.props.auth.user.id, username);
validForm();
hideCreateUsernameDialog();
} else {
invalidForm(t('createdisplay.check_the_form'));
}