From 26955f964ab8e11d940099a127368b896e135531 Mon Sep 17 00:00:00 2001 From: Amirhossein Mahmoodi Date: Sun, 14 Jul 2024 14:10:35 +0330 Subject: [PATCH] update --- .../inquiryPrivacyFencing/Actions/Create/index.jsx | 3 ++- .../inquiryPrivacyFencing/Forms/CreateOrUpdate.jsx | 7 +++---- .../Forms/LocationOnMap/MarkerLocation/index.jsx | 5 +++-- .../inquiryPrivacyFencing/Forms/LocationOnMap/index.jsx | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/dashboard/inquiryPrivacyFencing/Actions/Create/index.jsx b/src/components/dashboard/inquiryPrivacyFencing/Actions/Create/index.jsx index 88dbb53..0a4e331 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/Actions/Create/index.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/Actions/Create/index.jsx @@ -3,6 +3,7 @@ import DialogTransition from "@/core/components/DialogTransition"; import { Close } from "@mui/icons-material"; import { Dialog, DialogTitle, IconButton } from "@mui/material"; import CreateOrUpdateForm from "../../Forms/CreateOrUpdate"; +import { SET_INQUIRE_PRIVACY_FENCING } from "@/core/utils/routes"; const InquiryPrivacyFencingCreate = ({ open, handleClose, mutate }) => { @@ -24,7 +25,7 @@ const InquiryPrivacyFencingCreate = ({ open, handleClose, mutate }) => { > - + ); diff --git a/src/components/dashboard/inquiryPrivacyFencing/Forms/CreateOrUpdate.jsx b/src/components/dashboard/inquiryPrivacyFencing/Forms/CreateOrUpdate.jsx index 9d8761b..18e511c 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/Forms/CreateOrUpdate.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/Forms/CreateOrUpdate.jsx @@ -1,6 +1,5 @@ import LtrTextField from "@/core/components/LtrTextField"; import StyledForm from "@/core/components/StyledForm"; -import { SET_INQUIRE_PRIVACY_FENCING } from "@/core/utils/routes"; import useRequest from "@/lib/hooks/useRequest"; import { Autocomplete, Box, Button, Chip, DialogActions, DialogContent, Fade, Grid, InputAdornment, Stack, TextField, Typography } from "@mui/material"; import { DatePicker, LocalizationProvider, faIR } from "@mui/x-date-pickers"; @@ -66,7 +65,7 @@ const initValues = { ronevesht: '', } -const CreateOrUpdateForm = ({ handleClose, mutate, defaultValues }) => { +const CreateOrUpdateForm = ({ handleClose, mutate, defaultValues, url }) => { const request = useRequest() const { control, watch, register, handleSubmit, setValue, formState: { isSubmitting } } = useForm({ defaultValues: defaultValues || initValues }); @@ -128,7 +127,7 @@ const CreateOrUpdateForm = ({ handleClose, mutate, defaultValues }) => { formData.append('ronevesht', data.ronevesht) try { - await request(SET_INQUIRE_PRIVACY_FENCING, 'post', { data: formData }) + await request(url, 'post', { data: formData }) handleClose() mutate() } catch (error) { @@ -374,7 +373,7 @@ const CreateOrUpdateForm = ({ handleClose, mutate, defaultValues }) => { - + diff --git a/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/MarkerLocation/index.jsx b/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/MarkerLocation/index.jsx index a75d191..0219c9e 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/MarkerLocation/index.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/MarkerLocation/index.jsx @@ -9,7 +9,7 @@ const locationMarker = L.icon({ iconAnchor: [25, 50], }); -const MarkerLocation = ({ setValue }) => { +const MarkerLocation = ({ setValue, defaultLatLon }) => { const location = useRef(); const map = useMapEvents({ move: (e) => { @@ -25,8 +25,9 @@ const MarkerLocation = ({ setValue }) => { setValue('lon', latlon.lng) }, }); + return ( - + ) } export default MarkerLocation \ No newline at end of file diff --git a/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/index.jsx b/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/index.jsx index e5b9860..fe65106 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/index.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/Forms/LocationOnMap/index.jsx @@ -8,12 +8,12 @@ const MapLayer = dynamic(() => import("@/core/components/MapLayer"), { ssr: false, }); -const LocationOnMap = ({ setValue }) => { +const LocationOnMap = ({ setValue, defaultLatLon }) => { return ( - +