Created
August 11, 2018 00:15
-
-
Save mpaccione/adc914dae015049ab25303c8b1d57053 to your computer and use it in GitHub Desktop.
catch doesnt work
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
fetch("https://www.mystrainconnect.com:8081/getAllUsers", | |
{ | |
method: "GET", | |
headers: { | |
'Content-Type': 'application/json' | |
} | |
}).then(res => res.json()) | |
.catch(error => console.error('Error:', error)) | |
.then(response => { | |
console.log('Success:', response); | |
this.commit("setAllUsers", response); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment