Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleDelete = (event: any) => {
this.setState({
isDeleting: true,
})
return API.del("goals", `/goals/${this.props.match.params.id}`, null).then((value: any) => {
this.setState({
isDeleting: false,
showDeleteModal: false,
redirect: '/'
});
});
}
onCancel() {
if (!window.confirm('just making sure—are you sure you\'d like to drop this room? thanks for being so considerate and giving other hackers a chance!')) { return; }
API.del("treehacks", `/rooms`, {})
.then(this._updateFromApi)
.catch(e => alert(`Couldn't drop room: ${e.response.data.message}`));
}