Call onSuccess and onSubmitted from props after AJAX response

This commit is contained in:
Tomasz Sterna 2015-01-19 14:08:40 +01:00
parent b8c4414976
commit 196bba3fda
1 changed files with 2 additions and 2 deletions

View File

@ -225,8 +225,8 @@ Formsy.Form = React.createClass({
ajax[this.props.method || 'post'](this.props.url, this.model, this.props.contentType || options.contentType || 'json', headers)
.then(function (response) {
this.onSuccess(response);
this.onSubmitted();
this.props.onSuccess(response);
this.props.onSubmitted();
}.bind(this))
.catch(this.failSubmit);
},