fix(FE): refactor sales order form create

This commit is contained in:
randy-ar
2026-01-31 13:15:47 +07:00
parent d92a63db41
commit 70bb40d4f2
10 changed files with 1060 additions and 238 deletions
+6
View File
@@ -5,6 +5,7 @@ import { useState } from 'react';
interface UseFormikErrorListOptions {
onBeforeSubmit?: (e: React.FormEvent<HTMLFormElement>) => boolean | void;
onAfterValidation?: () => void | Promise<void>;
onAfterSubmit?: () => void | Promise<void>;
}
export const useFormikErrorList = <T>(
@@ -49,6 +50,11 @@ export const useFormikErrorList = <T>(
// Submit form
formik.handleSubmit();
// Call onAfterSubmit callback if validation passed
if (options?.onAfterSubmit) {
await options.onAfterSubmit();
}
};
const close = () => {