mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 05:45:46 +00:00
fix(FE): refactor sales order form create
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user