/** @format */

import * as React from 'react';
import {notification} from 'antd';
import message from '../../../../components/message';
import IntrerfaceForm from '../components/interfaceForm';
import {useBaseApiInsert} from '../../../../service/baseApi';
const editInterface: React.FC = () => {
    const [insertState, requestInsertBaseApi] = useBaseApiInsert();
    const handleSubmit = (values: any) => {
        requestInsertBaseApi(values).then(error => {
            if (error) {
                return notification.error({
                    message: '新增基础API失败!',
                    description: error,
                });
            }
            message.success('新增基础API成功!');
        });
    };
    return <IntrerfaceForm loading={insertState.loading} onSubmit={handleSubmit} />;
};
export default editInterface;
