Skip to content

Commit

Permalink
feat: make onSave optional (deriv-com#13635)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-deriv authored and vinu-deriv committed Feb 19, 2024
1 parent 213b5c4 commit ca9603b
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 ca9603b

Please sign in to comment.