Guillermo - add-edit-password-frontend-areyousure [skip ci]

This commit is contained in:
AntonyAntonio 2016-09-16 20:06:53 -03:00
parent 3bd5db9bf0
commit 1487df9a93
1 changed files with 12 additions and 4 deletions

View File

@ -6,6 +6,8 @@ import Header from 'core-components/header';
import Form from 'core-components/form'; import Form from 'core-components/form';
import FormField from 'core-components/form-field'; import FormField from 'core-components/form-field';
import SubmitButton from 'core-components/submit-button'; import SubmitButton from 'core-components/submit-button';
import ModalContainer from 'app/modal-container';
import AreYouSure from 'app-components/are-you-sure';
class DashboardEditProfilePage extends React.Component { class DashboardEditProfilePage extends React.Component {
@ -36,10 +38,17 @@ class DashboardEditProfilePage extends React.Component {
} }
onSubmitEditEmail(formState) { onSubmitEditEmail(formState) {
ModalContainer.openModal(<AreYouSure onYes={this.callEditEmailAPI.bind(this, formState)}/>);
}
onSubmitEditPassword(formState) {
ModalContainer.openModal(<AreYouSure onYes={this.callEditPassAPI.bind(this, formState)}/>);
}
callEditEmailAPI(formState){
this.setState({ this.setState({
loadingEmail: true loadingEmail: true
}); });
API.call({ API.call({
path: "/user/edit-email", path: "/user/edit-email",
data: { data: {
@ -52,11 +61,10 @@ class DashboardEditProfilePage extends React.Component {
}.bind(this)); }.bind(this));
} }
onSubmitEditPassword(formState) { callEditPassAPI(formState){
this.setState({ this.setState({
loadingPass: true loadingPass: true
}); });
API.call({ API.call({
path: "/user/edit-password", path: "/user/edit-password",
data: { data: {