add form create inquiryPrivacyFencing

This commit is contained in:
Amirhossein Mahmoodi
2024-07-13 14:02:55 +03:30
parent 5183fddcdf
commit 7d864ccf6b
4 changed files with 33 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ import moment from "jalali-moment";
import { Controller, useForm } from "react-hook-form";
import LocationOnMap from "./LocationOnMap";
const CreateForm = ({ handleClose }) => {
const CreateForm = ({ handleClose, mutate }) => {
const { control, watch, register, handleSubmit, setValue } = useForm({
defaultValues: {
dabirkhaneh_number: '',
@@ -130,6 +130,7 @@ const CreateForm = ({ handleClose }) => {
try {
await request(SET_INQUIRE_PRIVACY_FENCING, 'post', { data: formData })
handleClose()
mutate()
} catch (error) {
}
@@ -441,7 +442,7 @@ const CreateForm = ({ handleClose }) => {
value.map((option, index) => {
const { key, ...tagProps } = getTagProps({ index });
return (
<Chip label={option} key={key} {...tagProps} />
<Chip label={option} key={key} size="small" {...tagProps} />
);
})
}

View File

@@ -4,7 +4,7 @@ import { Close } from "@mui/icons-material";
import { Dialog, DialogTitle, IconButton } from "@mui/material";
import CreateForm from "./Form";
const InquiryPrivacyFencingCreate = ({ open, handleClose }) => {
const InquiryPrivacyFencingCreate = ({ open, handleClose, mutate }) => {
return (
<>
@@ -24,7 +24,7 @@ const InquiryPrivacyFencingCreate = ({ open, handleClose }) => {
>
<Close />
</IconButton>
<CreateForm handleClose={handleClose} />
<CreateForm handleClose={handleClose} mutate={mutate} />
</Dialog>
</>
);