Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function manageThread(e: React.SyntheticEvent) {
e.preventDefault();
setSending(true);
const form = {
...values,
body,
};
if (thread) {
Inertia.put(`/forum/threads/${id}`, form).then(() => {
setSending(false);
onClose();
window.location.reload();
}).catch((error) => {
console.error(error);
});
} else {
Inertia.post(`/forum/threads`, form).then(() => {
setSending(false);
}).catch((error) => {
console.error(error);
});
}
}
function handleSubmit(e: React.SyntheticEvent) {
e.preventDefault();
setSending(true);
Inertia.put('/profile/profile', values).then(() => {
setSending(false);
});
}
function handleSubmit(e: React.SyntheticEvent) {
e.preventDefault();
setSending(true);
const data = {
...values,
...locations,
};
Inertia.put('/profile/update', data).then(() => {
setSending(false);
});
}