feat: write REST API endpoint to create step

This commit is contained in:
Ali BARIN
2024-09-06 17:30:10 +00:00
parent 1ce31eefc6
commit 813646e392
8 changed files with 270 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
const flow = await request.currentUser.authorizedFlows
.clone()
.findById(request.params.flowId)
.throwIfNotFound();
const createdActionStep = await flow.createActionStep(
request.body.previousStepId
);
renderObject(response, createdActionStep, { status: 201 });
};