Update next step ids on step update (#11605)
When inserting a new step between step 1 et step 2, then step 1 should have the new step as next step id, add stop having step 2. When deleting a step, we link the parent and next steps together. It may change in the future
This commit is contained in:
@ -15,4 +15,16 @@ export class CreateWorkflowVersionStepInput {
|
||||
nullable: false,
|
||||
})
|
||||
stepType: WorkflowActionType;
|
||||
|
||||
@Field(() => String, {
|
||||
description: 'Parent step ID',
|
||||
nullable: true,
|
||||
})
|
||||
parentStepId?: string;
|
||||
|
||||
@Field(() => String, {
|
||||
description: 'Next step ID',
|
||||
nullable: true,
|
||||
})
|
||||
nextStepId?: string;
|
||||
}
|
||||
|
||||
@ -26,12 +26,11 @@ export class WorkflowStepResolver {
|
||||
async createWorkflowVersionStep(
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
@Args('input')
|
||||
{ stepType, workflowVersionId }: CreateWorkflowVersionStepInput,
|
||||
input: CreateWorkflowVersionStepInput,
|
||||
): Promise<WorkflowActionDTO> {
|
||||
return this.workflowVersionStepWorkspaceService.createWorkflowVersionStep({
|
||||
workspaceId,
|
||||
workflowVersionId,
|
||||
stepType,
|
||||
input,
|
||||
});
|
||||
}
|
||||
|
||||
@ -57,7 +56,7 @@ export class WorkflowStepResolver {
|
||||
return this.workflowVersionStepWorkspaceService.deleteWorkflowVersionStep({
|
||||
workspaceId,
|
||||
workflowVersionId,
|
||||
stepId,
|
||||
stepIdToDelete: stepId,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user