Last active
October 19, 2017 19:20
-
-
Save matthewtrask/73c9a175c04b21a55af4c0eda53a302f to your computer and use it in GitHub Desktop.
This file contains 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
function postJobs(){ | |
// we use axios to make the HTTP request | |
axios.post('/api/jobs') | |
// if request is successful, this is what needs to happen | |
.then(response => { | |
// do success stuff | |
}.catch((error => { | |
// we also get to handle errors, so this promise is where we catch the error and handle it gracefully. | |
console.error(error); | |
} | |
} | |
function postJobs(){ | |
axios.post('/api/jobs') | |
.then(response => { | |
// do success stuff | |
}.catch((error => { | |
console.error(error); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment