diff --git a/packages/backend/src/graphql/mutations/create-step.ts b/packages/backend/src/graphql/mutations/create-step.ts index fdb8ea76..e332623a 100644 --- a/packages/backend/src/graphql/mutations/create-step.ts +++ b/packages/backend/src/graphql/mutations/create-step.ts @@ -45,7 +45,6 @@ const createStepResolver = async ( key: input.key, appKey: input.appKey, type: 'action', - connectionId: input.connection?.id, position: previousStep.position + 1, }); diff --git a/packages/backend/src/models/step.ts b/packages/backend/src/models/step.ts index ab285ad0..c01ea944 100644 --- a/packages/backend/src/models/step.ts +++ b/packages/backend/src/models/step.ts @@ -13,7 +13,7 @@ class Step extends Base { key: string; appKey: string; type!: StepEnumType; - connectionId!: number; + connectionId: number; position: number; parameters: any; @@ -29,7 +29,7 @@ class Step extends Base { key: { type: ['string', null] }, appKey: { type: 'string', minLength: 1, maxLength: 255 }, type: { type: 'string', enum: ['action', 'trigger'] }, - connectionId: { type: 'integer' }, + connectionId: { type: ['integer', null] }, position: { type: 'integer' }, parameters: { type: ['object', null] }, }, diff --git a/packages/web/src/components/Editor/index.tsx b/packages/web/src/components/Editor/index.tsx index 4838f0bf..c16878a6 100644 --- a/packages/web/src/components/Editor/index.tsx +++ b/packages/web/src/components/Editor/index.tsx @@ -53,7 +53,6 @@ export default function Editor(props: EditorProps): React.ReactElement { const mutationInput: Record = { id: step.id, key: step.key, - previousStepId: step.previousStepId, connection: { id: step.connection?.id }, @@ -71,7 +70,9 @@ export default function Editor(props: EditorProps): React.ReactElement { const addStep = React.useCallback((previousStepId) => { const mutationInput = { - previousStepId: previousStepId, + previousStep: { + id: previousStepId, + }, flow: { id: flow.id, },