MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / submit

Function submit

web/src/pages/User/AddUser.js:39–52  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 4

showSuccessFunction · 0.90
showErrorFunction · 0.90
getInitValuesFunction · 0.70
tFunction · 0.50

Tested by

no test coverage detected