(values)
| 37 | }); |
| 38 | |
| 39 | const submit = async (values) => { |
| 40 | setLoading(true); |
| 41 | const res = await API.post(`/api/user/`, values); |
| 42 | const { success, message } = res.data; |
| 43 | if (success) { |
| 44 | showSuccess(t('用户账户创建成功!')); |
| 45 | formApiRef.current?.setValues(getInitValues()); |
| 46 | props.refresh(); |
| 47 | props.handleClose(); |
| 48 | } else { |
| 49 | showError(message); |
| 50 | } |
| 51 | setLoading(false); |
| 52 | }; |
| 53 | |
| 54 | const handleCancel = () => { |
| 55 | props.handleClose(); |
nothing calls this directly
no test coverage detected