feat: Implement create flow rest API endpoint

This commit is contained in:
Faruk AYDIN
2024-09-02 15:01:20 +03:00
parent b8a25b87d8
commit 79e9455244
6 changed files with 109 additions and 0 deletions

View File

@@ -119,6 +119,22 @@ class Flow extends Base {
});
}
async createInitialSteps() {
await Step.query().insert({
flowId: this.id,
type: 'trigger',
position: 1,
});
await Step.query().insert({
flowId: this.id,
type: 'action',
position: 2,
});
return this.$query().withGraphFetched('steps');
}
async $beforeUpdate(opt, queryContext) {
await super.$beforeUpdate(opt, queryContext);