feat: write PATCH /v1/flows/:flowId

This commit is contained in:
Ali BARIN
2024-08-29 14:16:17 +00:00
parent 35bada360d
commit 9519ec53ef
5 changed files with 196 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
const flow = await request.currentUser.authorizedFlows
.findOne({
id: request.params.flowId,
})
.throwIfNotFound();
await flow.$query().patchAndFetch({
name: request.body.name,
});
renderObject(response, flow);
};