Skip to content

Commit b8075bc

Browse files
committed
refactor:added notification message for current step data in contentMapper function of migration component
1 parent c0bae06 commit b8075bc

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

ui/src/pages/Migration/index.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,12 +623,22 @@ const Migration = () => {
623623
}
624624
});
625625
} else {
626-
event.preventDefault();
627-
const url = `/projects/${projectId}/migration/steps/4`;
628-
navigate(url, { replace: true });
629626

630-
await updateCurrentStepData(selectedOrganisation.value, projectId);
631-
handleStepChange(3);
627+
const res = await updateCurrentStepData(selectedOrganisation.value, projectId);
628+
if (res?.status === 200) {
629+
setIsLoading(false);
630+
event.preventDefault();
631+
handleStepChange(3);
632+
const url = `/projects/${projectId}/migration/steps/4`;
633+
navigate(url, { replace: true });
634+
} else {
635+
setIsLoading(false);
636+
Notification({
637+
notificationContent: { text: res?.data?.error?.message },
638+
type: 'error'
639+
});
640+
}
641+
632642
}
633643
};
634644

@@ -722,7 +732,7 @@ const Migration = () => {
722732
<div className="steps-wrapper">
723733
<HorizontalStepper
724734
ref={stepperRef}
725-
steps={createStepper(projectData ?? defaultMigrationResponse, handleClick)}
735+
steps={createStepper(projectData ?? defaultMigrationResponse, handleStepChange)}
726736
handleSaveCT={saveRef?.current?.handleSaveContentType}
727737
changeDropdownState={changeDropdownState}
728738
projectData={projectData || defaultMigrationResponse}

0 commit comments

Comments
 (0)