feat: Create empty trigger step when the flow is created

This commit is contained in:
Faruk AYDIN
2022-01-05 23:24:31 +03:00
committed by Ömer Faruk Aydın
parent 247b25cfc4
commit c07b377de1
6 changed files with 31 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
import Flow from '../../models/flow';
import Step from '../../models/step';
import flowType from '../types/flow';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
@@ -7,6 +8,11 @@ const createFlowResolver = async (req: RequestWithCurrentUser) => {
userId: req.currentUser.id
});
await Step.query().insert({
flowId: flow.id,
type: 'trigger'
})
return flow;
}