diff --git a/packages/backend/src/graphql/mutations/create-step.ts b/packages/backend/src/graphql/mutations/create-step.ts index 80ba0a1c..7ee065d4 100644 --- a/packages/backend/src/graphql/mutations/create-step.ts +++ b/packages/backend/src/graphql/mutations/create-step.ts @@ -1,3 +1,4 @@ +import App from '../../models/app'; import Context from '../../types/express/context'; type Params = { @@ -23,6 +24,14 @@ const createStep = async ( ) => { const { input } = params; + if (input.appKey && input.key) { + await App.checkAppAndAction(input.appKey, input.key); + } + + if (input.appKey && !input.key) { + await App.findOneByKey(input.appKey); + } + const flow = await context.currentUser .$relatedQuery('flows') .findOne({