Skip to content

Commit

Permalink
Simplify onSubmit handler
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
rszwajko committed Mar 22, 2024
1 parent dce1777 commit 02ff10d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ApplicationFormModal: React.FC<ApplicationFormModalProps> = ({
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={formProps.isSubmitDisabled}
onClick={formProps.onSubmit()}
onClick={formProps.onSubmit}
>
{!application ? t("actions.create") : t("actions.save")}
</Button>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,13 @@ export const useApplicationFormHook = ({
isCancelDisabled: isSubmitting || isValidating,
stakeholders,
businessServiceOptions,
onSubmit: () => handleSubmit(onValidSubmit),
onSubmit: handleSubmit(onValidSubmit),
};
};

export const ApplicationForm: React.FC<
ReturnType<typeof useApplicationFormHook>
> = ({
onSubmit,
setBasicExpanded,
isBasicExpanded,
control,
Expand All @@ -353,7 +352,7 @@ export const ApplicationForm: React.FC<
}) => {
const { t } = useTranslation();
return (
<Form onSubmit={onSubmit}>
<Form>
<ExpandableSection
toggleText={"Basic information"}
className="toggle"
Expand Down

0 comments on commit 02ff10d

Please sign in to comment.