refactor: Only return JSON for flow export
This commit is contained in:
@@ -1,9 +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 { exportedFlowAsString, slug } = await flow.export();
|
||||
const exportedFlow = await flow.export();
|
||||
|
||||
response.status(201).attachment(slug).send(exportedFlowAsString);
|
||||
return renderObject(response, exportedFlow, { status: 201 });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user