Skip to content

Commit 4da359a

Browse files
authored
fix: fixed cf status duplicate (#2822)
1 parent 3af904d commit 4da359a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

services/workflows-service/src/collection-flow/controllers/collection-flow.controller.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,25 @@ export class CollectionFlowController {
145145
tokenScope.projectId,
146146
);
147147

148-
const collectionFlow = getCollectionFlowState(event.context);
148+
const collectionFlowState = getCollectionFlowState(event.context);
149149

150-
if (!collectionFlow) {
150+
if (!collectionFlowState) {
151151
throw new CollectionFlowMissingException();
152152
}
153153

154-
collectionFlow.status = CollectionFlowStatusesEnum.completed;
154+
collectionFlowState.status = CollectionFlowStatusesEnum.completed;
155155

156156
return await this.workflowService.event(
157157
{
158158
id: tokenScope.workflowRuntimeDataId,
159159
name: BUILT_IN_EVENT.DEEP_MERGE_CONTEXT,
160160
payload: {
161-
newContext: { collectionFlow },
162-
arrayMergeOption: ARRAY_MERGE_OPTION.BY_ID,
161+
newContext: {
162+
collectionFlow: {
163+
state: collectionFlowState,
164+
},
165+
},
166+
arrayMergeOption: ARRAY_MERGE_OPTION.REPLACE,
163167
},
164168
},
165169
[tokenScope.projectId],
@@ -178,10 +182,12 @@ export class CollectionFlowController {
178182
payload: {
179183
newContext: {
180184
collectionFlow: {
181-
status: CollectionFlowStatusesEnum.failed,
185+
state: {
186+
status: CollectionFlowStatusesEnum.failed,
187+
},
182188
},
183189
},
184-
arrayMergeOption: ARRAY_MERGE_OPTION.BY_ID,
190+
arrayMergeOption: ARRAY_MERGE_OPTION.REPLACE,
185191
},
186192
},
187193
[tokenScope.projectId],

0 commit comments

Comments
 (0)