|
|
@@ -60,7 +60,11 @@ export function useSubmitHandler(options = {}) {
|
|
|
|
|
|
try {
|
|
|
const response = await apiCallThunk();
|
|
|
- if (typeof onSuccess === "function") await onSuccess(response);
|
|
|
+ if (typeof onSuccess === "function") {
|
|
|
+ await onSuccess(response);
|
|
|
+ } else {
|
|
|
+ return response;
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
await handleError(error);
|
|
|
} finally {
|