Merge pull request #13 from smokku/props_callback
Call onSuccess and onSubmitted from props after AJAX response
This commit is contained in:
commit
23bad21119
|
|
@ -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);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue