change: form actions to safe client side handlers

This commit is contained in:
Mahyar Khanbolooki
2025-08-09 15:10:02 +03:30
parent f7eb07cc13
commit bb73e3ff6f
3 changed files with 15 additions and 9 deletions
@@ -49,7 +49,9 @@ function RatingOrderIndex({ }: Props) {
)
}
const submitForm = (formData: FormData) => {
const submitForm = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
const formData = new FormData(e.currentTarget);
console.log(formData.get('rating'))
}
@@ -57,7 +59,7 @@ function RatingOrderIndex({ }: Props) {
<section className='flex flex-col h-full pt-6'>
<h1 className='font-medium'>{t("Heading")}</h1>
<form action={submitForm} className='bg-container flex flex-col h-min justify-between rounded-[30px] pt-10 px-6 pb-7.5 mt-4'>
<form onSubmit={submitForm} className='bg-container flex flex-col h-min justify-between rounded-[30px] pt-10 px-6 pb-7.5 mt-4'>
<div>
<div className='w-full'>