Last active
March 2, 2017 21:36
-
-
Save ericdfields/75850a95006c592af5697b3fe19005b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ajax = require('superagent') | |
require('superagent-rails-csrf')(ajax) | |
export default ajax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ajax | |
.post( parseHref(this.props) ) | |
.setCsrfToken() | |
.send( updatedPayload(payload,entity) ) | |
.end( (err,response) => { | |
if (err) { | |
return standardError() | |
} | |
this.setDisabled() | |
this.props.callback && this.props.callback() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment