Merge pull request #13 from smokku/props_callback

Call onSuccess and onSubmitted from props after AJAX response
This commit is contained in:
Christian Alfoni 2015-01-19 18:38:31 +01:00
commit 23bad21119
1 changed files with 2 additions and 2 deletions

View File

@ -230,8 +230,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);
},