iam just ask how to change method put to post in FormHelper Inertia js, with reactjs sir ?, because iam using formHelper its not working ? are u have suggest. This my code,
const submitHandlerType = (event) => {
event.preventDefault()
Inertia.post(route("products.update", model.id), {
_method: 'put',
name: data.name,
category_id: data.category_id,
descriptions: data.descriptions,
bestproduct: data.bestproduct,
image: data.image,
},{
onSuccess: () => {reset(), close()},
}
)
};
its work, but how to doit with formHelper ?
=========================>
const { data, setData, post, reset, errors, processing, progress } = useForm({
name: model.name,
category_id: model.category_id,
descriptions: model.descriptions,
bestproduct: model.bestproduct,
image: null,
});
const submitHandlerType = (event) => {
event.preventDefault();
post(route("products.update", model.id), {
data,
onSuccess: () => {
reset(), close();
},
});
};
i got null if i die dump in controller with formHelper inertia, please help me thanks