fix: make connectionId optional step model
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
3925de13a7
commit
da9ab8016b
@@ -45,7 +45,6 @@ const createStepResolver = async (
|
|||||||
key: input.key,
|
key: input.key,
|
||||||
appKey: input.appKey,
|
appKey: input.appKey,
|
||||||
type: 'action',
|
type: 'action',
|
||||||
connectionId: input.connection?.id,
|
|
||||||
position: previousStep.position + 1,
|
position: previousStep.position + 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ class Step extends Base {
|
|||||||
key: string;
|
key: string;
|
||||||
appKey: string;
|
appKey: string;
|
||||||
type!: StepEnumType;
|
type!: StepEnumType;
|
||||||
connectionId!: number;
|
connectionId: number;
|
||||||
position: number;
|
position: number;
|
||||||
parameters: any;
|
parameters: any;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class Step extends Base {
|
|||||||
key: { type: ['string', null] },
|
key: { type: ['string', null] },
|
||||||
appKey: { type: 'string', minLength: 1, maxLength: 255 },
|
appKey: { type: 'string', minLength: 1, maxLength: 255 },
|
||||||
type: { type: 'string', enum: ['action', 'trigger'] },
|
type: { type: 'string', enum: ['action', 'trigger'] },
|
||||||
connectionId: { type: 'integer' },
|
connectionId: { type: ['integer', null] },
|
||||||
position: { type: 'integer' },
|
position: { type: 'integer' },
|
||||||
parameters: { type: ['object', null] },
|
parameters: { type: ['object', null] },
|
||||||
},
|
},
|
||||||
|
@@ -53,7 +53,6 @@ export default function Editor(props: EditorProps): React.ReactElement {
|
|||||||
const mutationInput: Record<string, unknown> = {
|
const mutationInput: Record<string, unknown> = {
|
||||||
id: step.id,
|
id: step.id,
|
||||||
key: step.key,
|
key: step.key,
|
||||||
previousStepId: step.previousStepId,
|
|
||||||
connection: {
|
connection: {
|
||||||
id: step.connection?.id
|
id: step.connection?.id
|
||||||
},
|
},
|
||||||
@@ -71,7 +70,9 @@ export default function Editor(props: EditorProps): React.ReactElement {
|
|||||||
|
|
||||||
const addStep = React.useCallback((previousStepId) => {
|
const addStep = React.useCallback((previousStepId) => {
|
||||||
const mutationInput = {
|
const mutationInput = {
|
||||||
previousStepId: previousStepId,
|
previousStep: {
|
||||||
|
id: previousStepId,
|
||||||
|
},
|
||||||
flow: {
|
flow: {
|
||||||
id: flow.id,
|
id: flow.id,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user