File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
packages/backend/src/graphql/mutations Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -13,18 +13,19 @@ const createStep: MutationResolvers['createStep'] = async (
1313) => {
1414 const { input } = params
1515
16- const triggerOrAction = await App . findTriggerOrActionByKey (
17- input . appKey ,
18- input . key ,
19- )
16+ /**
17+ * appKey and key are optional, we allow creating of empty step for if-then branches
18+ */
19+ if ( input . appKey && input . key ) {
20+ const triggerOrAction = await App . findTriggerOrActionByKey (
21+ input . appKey ,
22+ input . key ,
23+ )
2024
21- if ( ! triggerOrAction ) {
22- throw new BadUserInputError ( 'No such trigger or action' )
23- }
24- if ( 'hiddenFromUser' in triggerOrAction && triggerOrAction . hiddenFromUser ) {
25- throw new BadUserInputError ( 'Action can only be created by system' )
25+ if ( 'hiddenFromUser' in triggerOrAction && triggerOrAction . hiddenFromUser ) {
26+ throw new BadUserInputError ( 'Action can only be created by system' )
27+ }
2628 }
27-
2829 return await Step . transaction ( async ( trx ) => {
2930 await trx . raw ( 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;' )
3031
You can’t perform that action at this time.
0 commit comments