Pārlūkot izejas kodu

Fix: Return response from submit handler

DenLopes 1 mēnesi atpakaļ
vecāks
revīzija
da8aec40e7
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  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 {