From 51e02f2aa63bc479f37ecdb18dd1d90f4da4213a Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Tue, 3 Jun 2025 10:20:51 +0330 Subject: [PATCH] remove field province --- .../complaintList/RowActions/Refer/ReferContent.jsx | 12 ++++++------ .../complaintList/RowActions/Refer/index.jsx | 5 +++-- .../fastReact/complaintList/RowActions/index.jsx | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/dashboard/fastReact/complaintList/RowActions/Refer/ReferContent.jsx b/src/components/dashboard/fastReact/complaintList/RowActions/Refer/ReferContent.jsx index 705fabf..ef74d91 100644 --- a/src/components/dashboard/fastReact/complaintList/RowActions/Refer/ReferContent.jsx +++ b/src/components/dashboard/fastReact/complaintList/RowActions/Refer/ReferContent.jsx @@ -7,7 +7,7 @@ import * as Yup from "yup"; import EdarateShahriField from "./EdarateShahriField"; import ProvinceField from "./ProvinceField"; -const ReferContent = ({ rowId, mutate, setOpenReferDialog }) => { +const ReferContent = ({ row, mutate, setOpenReferDialog }) => { const requestServer = useRequest({ notificationSuccess: true }); const validationSchema = Yup.object().shape({ @@ -23,7 +23,7 @@ const ReferContent = ({ rowId, mutate, setOpenReferDialog }) => { formState: { errors, isSubmitting }, } = useForm({ defaultValues: { - province_id: "", + province_id: row.original.province_id, edarat_shahri_id: "", description: "", }, @@ -36,7 +36,7 @@ const ReferContent = ({ rowId, mutate, setOpenReferDialog }) => { formData.append("province_id", data.province_id); formData.append("edarate_shahri_id", data.edarat_shahri_id); formData.append("refer_description", data.description); - await requestServer(`${REFER_FAST_REACT}/${rowId}`, "post", { + await requestServer(`${REFER_FAST_REACT}/${row.original.id}`, "post", { data: formData, hasSidebarUpdate: true, }) @@ -44,20 +44,20 @@ const ReferContent = ({ rowId, mutate, setOpenReferDialog }) => { mutate(); setOpenReferDialog(false); }) - .catch(() => {}); + .catch(() => { }); }; return ( <> - { return ; }} - /> + /> */} { +const Refer = ({ row, mutate }) => { const [openReferDialog, setOpenReferDialog] = useState(false); + return ( <> @@ -24,7 +25,7 @@ const Refer = ({ rowId, mutate }) => { > ارجاع {openReferDialog && ( - + )} diff --git a/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx b/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx index 081a536..f272407 100644 --- a/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx +++ b/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx @@ -16,7 +16,7 @@ const RowActions = ({ row, mutate, mutateParentTable }) => { rowId={row.getValue("road_observeds__id")} /> )} - + );