feat: Implement update flow status rest API endpoint

This commit is contained in:
Faruk AYDIN
2024-09-17 16:07:12 +03:00
parent 712a5756e2
commit 1790ef0ee6
7 changed files with 350 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
let flow = await request.currentUser.authorizedFlows
.clone()
.findOne({
id: request.params.flowId,
})
.throwIfNotFound();
flow = await flow.updateStatus(request.body.active);
renderObject(response, flow);
};