feat(api): add update flow status endpoint
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import Flow from '../../../../models/flow.js';
|
||||
import { renderObject } from '../../../../helpers/renderer.js';
|
||||
|
||||
export default async (request, response) => {
|
||||
let flow = await Flow.query()
|
||||
.findOne({
|
||||
id: request.params.flowId,
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
flow = await flow.updateStatus(request.body.active);
|
||||
|
||||
renderObject(response, flow);
|
||||
};
|
||||
Reference in New Issue
Block a user