@@ -23,7 +23,7 @@ import {
2323 DEFAULT_IFLOWSTEP ,
2424 IFlowStep
2525} from '../../components/Stepper/FlowStepper/flowStep.interface' ;
26- import { IDropDown , INewMigration , ICMSType , ILegacyCMSComponent , DEFAULT_CMS_TYPE } from '../../context/app/app.interface' ;
26+ import { IDropDown , INewMigration , ICMSType , ILegacyCMSComponent , DEFAULT_CMS_TYPE , TestStacks } from '../../context/app/app.interface' ;
2727import { ContentTypeSaveHandles } from '../../components/ContentMapper/contentMapper.interface' ;
2828import { ICardType } from "../../components/Common/Card/card.interface" ;
2929import { ModalObj } from '../../components/Modal/modal.interface' ;
@@ -203,6 +203,7 @@ const Migration = () => {
203203 const existingGlobalFields = await fetchExistingGlobalFields ( ) ;
204204
205205 const stackLink = `${ CS_URL [ projectData ?. region ] } /stack/${ projectData ?. current_test_stack_id } /dashboard` ;
206+ const stackName = projectData ?. test_stacks ?. find ( ( stack :TestStacks ) => stack ?. stackUid === projectData ?. current_test_stack_id ) ?. stackName ;
206207
207208 const projectMapper = {
208209 ...newMigrationData ,
@@ -245,7 +246,8 @@ const Migration = () => {
245246 stack_link : stackLink ,
246247 stack_api_key : projectData ?. current_test_stack_id ,
247248 isMigrationStarted : newMigrationData ?. test_migration ?. isMigrationStarted || false ,
248- isMigrationComplete : newMigrationData ?. test_migration ?. isMigrationStarted || false
249+ isMigrationComplete : newMigrationData ?. test_migration ?. isMigrationStarted || false ,
250+ stack_name : stackName ,
249251 } ,
250252 migration_execution : {
251253 migrationStarted : projectData ?. isMigrationStarted ,
@@ -361,8 +363,9 @@ const Migration = () => {
361363 }
362364 } ) ;
363365 const res = await updateCurrentStepData ( selectedOrganisation . value , projectId ) ;
366+
364367 handleStepChange ( 1 ) ;
365- if ( res ) {
368+ if ( res ?. status === 200 ) {
366369 setIsLoading ( false ) ;
367370
368371 const url = `/projects/${ projectId } /migration/steps/2` ;
@@ -418,9 +421,9 @@ const Migration = () => {
418421 created_at :newMigrationData ?. destination_stack ?. selectedStack ?. created_at ,
419422 isNewStack : newMigrationData ?. destination_stack ?. selectedStack ?. isNewStack
420423 } )
421- handleStepChange ( 2 ) ;
422424 const res = await updateCurrentStepData ( selectedOrganisation ?. value , projectId ) ;
423- if ( res ) {
425+ if ( res ?. status === 200 ) {
426+ handleStepChange ( 2 ) ;
424427 setIsLoading ( false ) ;
425428 const url = `/projects/${ projectId } /migration/steps/3` ;
426429 navigate ( url , { replace : true } ) ;
@@ -486,8 +489,11 @@ const Migration = () => {
486489
487490 await updateMigrationKey ( selectedOrganisation . value , projectId ) ;
488491
489- await updateCurrentStepData ( selectedOrganisation . value , projectId ) ;
490- handleStepChange ( 4 ) ;
492+ const res = await updateCurrentStepData ( selectedOrganisation . value , projectId ) ;
493+ if ( res ?. status === 200 ) {
494+ handleStepChange ( 4 ) ;
495+ }
496+
491497 }
492498
493499 /**
0 commit comments