add form create inquiryPrivacyFencing
This commit is contained in:
@@ -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} />
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user