From 4345eba974da2f8e637fe392dcc76039369e64a6 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Mon, 22 Dec 2025 11:29:05 +0330 Subject: [PATCH] report fix --- src/app/[name]/(Dialogs)/report/enum/Enum.ts | 4 +++ src/app/[name]/(Dialogs)/report/page.tsx | 35 +++++++++++++++++-- .../[name]/(Dialogs)/report/types/Types.ts | 3 ++ src/components/input/InputField.tsx | 14 ++++---- src/components/input/PasswordField.tsx | 6 ++-- src/locales/fa/parallels.json | 7 ++++ 6 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 src/app/[name]/(Dialogs)/report/enum/Enum.ts diff --git a/src/app/[name]/(Dialogs)/report/enum/Enum.ts b/src/app/[name]/(Dialogs)/report/enum/Enum.ts new file mode 100644 index 0000000..b713807 --- /dev/null +++ b/src/app/[name]/(Dialogs)/report/enum/Enum.ts @@ -0,0 +1,4 @@ +export enum ContactScope { + APPLICATION = "application", + RESTAURANT = "restaurant", +} diff --git a/src/app/[name]/(Dialogs)/report/page.tsx b/src/app/[name]/(Dialogs)/report/page.tsx index b5458ec..efb7a11 100644 --- a/src/app/[name]/(Dialogs)/report/page.tsx +++ b/src/app/[name]/(Dialogs)/report/page.tsx @@ -13,6 +13,8 @@ import * as Yup from 'yup'; import { useCreateReport } from './hooks/useReportData'; import { toast } from '@/components/Toast'; import { extractErrorMessage } from '@/lib/func'; +import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; +import { ContactScope } from './enum/Enum'; type Props = object; @@ -28,10 +30,12 @@ function ReportIndex({ }: Props) { initialValues: { subject: '', content: '', + scope: ContactScope.RESTAURANT, }, validationSchema: Yup.object({ subject: Yup.string().required('این فیلد اجباری است'), content: Yup.string().required('این فیلد اجباری است'), + scope: Yup.string().oneOf([ContactScope.APPLICATION, ContactScope.RESTAURANT]).required('این فیلد اجباری است'), }), onSubmit: (values) => { createReport(values, { @@ -62,7 +66,7 @@ function ReportIndex({ }: Props) {
-
+

{t('FormHeading')}

@@ -70,6 +74,7 @@ function ReportIndex({ }: Props) {
+ +