import { Form as FormAnt, Input, Button } from "antd"; import { prof } from "../../API/LayoutApi/profile"; const ChangePassword = () => { const [form] = FormAnt.useForm(); const submit = () => { form.validateFields().then(async (values) => { form.resetFields(); await prof.changePass(values); }); }; return (
({ validator(_, value) { if (!value || getFieldValue("new_password") === value) { return Promise.resolve(); } return Promise.reject( new Error("The new password that you entered do not match!") ); }, }), ]} >
); }; export default ChangePassword;