feat: write REST API endpoint to duplicate flow
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { renderObject } from '../../../../helpers/renderer.js';
|
||||
|
||||
export default async (request, response) => {
|
||||
const flow = await request.currentUser.authorizedFlows
|
||||
.findById(request.params.flowId)
|
||||
.throwIfNotFound();
|
||||
|
||||
const duplicatedFlow = await flow.duplicateFor(request.currentUser);
|
||||
|
||||
renderObject(response, duplicatedFlow, { status: 201 });
|
||||
};
|
||||
Reference in New Issue
Block a user