From 5c057409b735df15cefd676f99fa91137570a605 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Fri, 7 Feb 2025 11:38:36 +0100 Subject: [PATCH] fix(frontend): resolve onSubmit issue --- frontend/src/contexts/dialogs.context.tsx | 1 - frontend/src/types/common/dialogs.types.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/contexts/dialogs.context.tsx b/frontend/src/contexts/dialogs.context.tsx index 756efb92..753af19f 100644 --- a/frontend/src/contexts/dialogs.context.tsx +++ b/frontend/src/contexts/dialogs.context.tsx @@ -137,7 +137,6 @@ function DialogsProvider(props: DialogProviderProps) { onClose={async (result) => { await closeDialog(promise, result); }} - onSubmit={() => {}} {...msgProps} /> ))} diff --git a/frontend/src/types/common/dialogs.types.ts b/frontend/src/types/common/dialogs.types.ts index 4f191c97..64191fc1 100644 --- a/frontend/src/types/common/dialogs.types.ts +++ b/frontend/src/types/common/dialogs.types.ts @@ -52,7 +52,7 @@ export interface DialogProps

{ */ onClose: (result: R) => Promise; - onSubmit: (e: BaseSyntheticEvent) => void; + onSubmit?: (e: BaseSyntheticEvent) => void; } export type DialogComponent = React.ComponentType>; @@ -157,7 +157,7 @@ export interface FormDialogProps // form export interface FormButtonsProps { - onSubmit: (e: BaseSyntheticEvent) => void; + onSubmit?: (e: BaseSyntheticEvent) => void; onCancel?: () => void; cancelButtonProps?: ButtonProps; confirmButtonProps?: ButtonProps;