File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/components/engagement/workflow/transitions Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,17 @@ import { EngagementWorkflowRepository } from '../engagement-workflow.repository'
10
10
export interface ResolveEngagementParams {
11
11
engagement : Engagement ;
12
12
moduleRef : ModuleRef ;
13
- migrationPrevStep ?: EngagementStatus ;
13
+ migrationPrevSteps ?: EngagementStatus [ ] ;
14
14
}
15
15
16
16
export const BackTo = (
17
17
...steps : EngagementStatus [ ]
18
18
) : DynamicState < Step , ResolveEngagementParams > => ( {
19
19
description : 'Back' ,
20
20
relatedStates : steps ,
21
- async resolve ( { engagement, moduleRef, migrationPrevStep } ) {
22
- if ( migrationPrevStep ) {
23
- return migrationPrevStep ;
21
+ async resolve ( { engagement, moduleRef, migrationPrevSteps } ) {
22
+ if ( migrationPrevSteps ) {
23
+ return migrationPrevSteps . find ( ( s ) => steps . includes ( s ) ) ?? steps [ 0 ] ;
24
24
}
25
25
const repo = moduleRef . get ( EngagementWorkflowRepository ) ;
26
26
const found = await repo . mostRecentStep ( engagement . id , steps ) ;
You can’t perform that action at this time.
0 commit comments