feat(api): add get flow endpoint

This commit is contained in:
Ali BARIN
2025-04-24 22:47:45 +00:00
parent e3b0eaa250
commit fecf434c28
5 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import Flow from '../../../../models/flow.js';
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
const flow = await Flow.query()
.withGraphJoined({ steps: true })
.orderBy('steps.position', 'asc')
.findOne({ 'flows.id': request.params.flowId })
.throwIfNotFound();
renderObject(response, flow);
};