Skip to content

Instantly share code, notes, and snippets.

@MichaelObi
Last active July 15, 2019 04:47
Show Gist options
  • Save MichaelObi/6e2a1fe1aec0741c19dc00aad26580f8 to your computer and use it in GitHub Desktop.
Save MichaelObi/6e2a1fe1aec0741c19dc00aad26580f8 to your computer and use it in GitHub Desktop.
const fetchBill = () => {
const api = "https://randomapi.com/api/006b08a801d82d0c9824dcfdfdfa3b3c"
fetch(api).then((response) => {
if (reponse.status !== 200) {
console.log("Error" + response.status)
return;
}
return response.json()
}).then((data) => {
displayCartTotal(data)
}).catch((err) => {
console.log('Fetch Error :-S', err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment