Skip to content

Instantly share code, notes, and snippets.

@Franckapik
Created August 13, 2019 21:59
Show Gist options
  • Select an option

  • Save Franckapik/f5ea8374a28e0fa74373f2096c540295 to your computer and use it in GitHub Desktop.

Select an option

Save Franckapik/f5ea8374a28e0fa74373f2096c540295 to your computer and use it in GitHub Desktop.
fetch('/saveInDB/livraison', {
credentials: 'include',
method: 'post',
body: JSON.stringify(values),
headers: new Headers({'Content-Type': 'application/json'})
})
.then(res => res.json())
.then(res => {
if (res.error) {
console.log(res.error);
} else {
console.log(res.success);
commandeStore.display = 'paiement';
commandeStore.status = '80vw';
}
});
@Franckapik
Copy link
Author

  fetch('/saveInDB/livraison', {
    credentials: 'include',
    method: 'post',
    body: JSON.stringify(values),
    headers: new Headers({'Content-Type': 'application/json'})
  })
  .then(res => res.json())
  .catch(res => console.log(res.error));
  .then(res => {
      console.log(res.success);
      commandeStore.display = 'paiement';
      commandeStore.status = '80vw';
    }
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment