import { Input, Modal, Form as FormAnt } from "antd"; import { serviceController } from "../../API/LayoutApi/services"; const AddService = ({ open, setOpen, refetch, }: { open: boolean; setOpen(open: boolean): void; refetch(): void; }) => { const [form] = FormAnt.useForm(); const handleCancel = () => { setOpen(!open); }; return (
{ form .validateFields() .then(async (values) => { form.resetFields(); await serviceController.addServiceController(values); setOpen(!open); refetch(); }) .catch(() => { refetch(); }); }} >
); }; export default AddService;