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

@@ -0,0 +1,11 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
let flow = await request.currentUser.$relatedQuery('flows').insert({
name: 'Name your flow',
});
flow = await flow.createInitialSteps();
renderObject(response, flow, { status: 201 });
};