feat(api): add update flow status endpoint

This commit is contained in:
Ali BARIN
2025-04-25 08:53:04 +00:00
parent ec005a072b
commit 79009fc31f
5 changed files with 136 additions and 3 deletions

View File

@@ -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);
};