Skip to content

Commit

Permalink
feat: make onSave optional (#13635) (#13650)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Baranovski <120570511+sergei-deriv@users.noreply.github.com>
  • Loading branch information
vinu-deriv and sergei-deriv committed Feb 19, 2024
1 parent 213b5c4 commit 6b16c2f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type TradingAssessmentFormProps = {
getCurrentStep: () => number;
onSubmit: (values?: TTradingAssessmentForm, action?: React.ReactNode, should_override?: boolean) => void;
onCancel: (form_data: TTradingAssessmentForm) => void;
onSave: (current_step: number, values: TTradingAssessmentForm) => void;
onSave?: (current_step: number, values: TTradingAssessmentForm) => void;
should_move_to_next: boolean;
setSubSectionIndex: (index: number) => void;
is_independent_section: boolean;
Expand Down Expand Up @@ -144,7 +144,7 @@ const TradingAssessmentForm = observer(

const handleValidate = (values: TTradingAssessmentForm) => {
const current_step = (getCurrentStep?.() || 1) - 1;
onSave(current_step, values);
onSave?.(current_step, values);

const errors: FormikErrors<TTradingAssessmentForm> = {};

Expand Down

0 comments on commit 6b16c2f

Please sign in to comment.