Skip to content

Instantly share code, notes, and snippets.

@yagamicoder
Last active October 3, 2017 16:47
Show Gist options
  • Save yagamicoder/6cf2d7a6d3aa000c82f9f7eb50b2198b to your computer and use it in GitHub Desktop.
Save yagamicoder/6cf2d7a6d3aa000c82f9f7eb50b2198b to your computer and use it in GitHub Desktop.
//Pretend delete() is a function that returns a Promise
const handleDeleteUser = id => {
try {
deleteUser(`/user/delete/${id}`).then(data => {
handleDeleteResponse(data);
}).catch(error => {
handleDeleteResponse(error);
});
} catch (error) {
handleDeleteResponse(error);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment