feat: Implement get step connection API endpoint

This commit is contained in:
Faruk AYDIN
2024-03-13 15:24:50 +01:00
parent d6923a2ff0
commit 9a0434be32
7 changed files with 186 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
const step = await request.currentUser.authorizedSteps
.findById(request.params.stepId)
.throwIfNotFound();
const connection = await step.$relatedQuery('connection').throwIfNotFound();
renderObject(response, connection);
};