feat: Implement get flow API endpoint

This commit is contained in:
Faruk AYDIN
2024-02-26 00:52:02 +01:00
parent 5aad68ec62
commit b93b465f09
7 changed files with 135 additions and 0 deletions

View File

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