test(flow): write model tests

This commit is contained in:
Ali BARIN
2024-10-23 13:00:04 +00:00
committed by Faruk AYDIN
parent 4023a6d1cc
commit fbf898be64
5 changed files with 256 additions and 32 deletions

View File

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