in source/4-landing-page-with-feedback-api/ui/src/Components/App.tsx [39:53]
function onClickButton() {
setLoading(true);
submitForm({ name, email, subject, details })
.then(response => {
if (response.status !== 200) {
onFail()
return;
}
setLoading(false);
setSubmitted(true);
})
.catch(err => {
onFail();
});
}