|
|
@ -90,6 +90,8 @@ const useFormUtils = < |
|
|
|
getErrorMsg, |
|
|
|
getErrorMsg, |
|
|
|
msgKey = 'api', |
|
|
|
msgKey = 'api', |
|
|
|
method, |
|
|
|
method, |
|
|
|
|
|
|
|
onError, |
|
|
|
|
|
|
|
onSuccess, |
|
|
|
setMsg = messageGroupRef?.current?.setMessage, |
|
|
|
setMsg = messageGroupRef?.current?.setMessage, |
|
|
|
successMsg, |
|
|
|
successMsg, |
|
|
|
url, |
|
|
|
url, |
|
|
@ -103,6 +105,8 @@ const useFormUtils = < |
|
|
|
children: successMsg, |
|
|
|
children: successMsg, |
|
|
|
type: 'info', |
|
|
|
type: 'info', |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onSuccess?.call(null); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((apiError) => { |
|
|
|
.catch((apiError) => { |
|
|
|
const emsg = handleAPIError(apiError); |
|
|
|
const emsg = handleAPIError(apiError); |
|
|
@ -110,6 +114,8 @@ const useFormUtils = < |
|
|
|
emsg.children = getErrorMsg(emsg.children); |
|
|
|
emsg.children = getErrorMsg(emsg.children); |
|
|
|
|
|
|
|
|
|
|
|
setMsg?.call(null, msgKey, emsg); |
|
|
|
setMsg?.call(null, msgKey, emsg); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onError?.call(null); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
.finally(() => { |
|
|
|
setFormSubmitting(false); |
|
|
|
setFormSubmitting(false); |
|
|
|