Last active
December 7, 2016 01:31
-
-
Save simistern/2ac1d50ef3e6327aea46df09fbc74203 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
export function postSubmissionEdit(body, cb) { | |
return function(dispatch) { | |
dispatch(postSubmissionEditRequest()) | |
superagent | |
.post(config.BASE + '/api/editsubmission') | |
.send(body) | |
.withCredentials() | |
.end((err, res) => { | |
if (err) { | |
alert(err.response.body.message) | |
dispatch(postSubmissionEditFailure(err)) | |
} else { | |
console.log("we have a response!"); | |
console.log(res); | |
dispatch(postSubmissionEditSuccess(res.body)) | |
if (cb) { | |
cb(res.body) | |
} | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment