feat: Implement create flow from template id
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { renderObject } from '../../../../helpers/renderer.js';
|
||||
|
||||
export default async (request, response) => {
|
||||
const flow = await request.currentUser.createEmptyFlow();
|
||||
const { templateId } = request.query;
|
||||
|
||||
const flow = templateId
|
||||
? await request.currentUser.createFlowFromTemplate(templateId)
|
||||
: await request.currentUser.createEmptyFlow();
|
||||
|
||||
renderObject(response, flow, { status: 201 });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user