소스 검색

Fix: Return response from submit handler

DenLopes 1 개월 전
부모
커밋
da8aec40e7
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/composables/useSubmitHandler.js

+ 5 - 1
src/composables/useSubmitHandler.js

@@ -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 {