fix(public-api): Fix error updating workflow with property not defined in the schema (#4089)

* fix(cli): catch errors on updating workflow

*  Don\'t allow additionalProperties in the workflow schema

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
This commit is contained in:
Mike Arvela
2022-09-14 11:40:45 -04:00
committed by GitHub
co-authored by ricardo
parent b2807cecb3
commit f40ae501b4
2 changed files with 8 additions and 1 deletions
@@ -1,4 +1,5 @@
type: object
additionalProperties: false
required:
- name
- nodes
@@ -198,7 +198,13 @@ export = {
await workflowRunner.remove(id.toString());
}
await updateWorkflow(sharedWorkflow.workflowId, updateData);
try {
await updateWorkflow(sharedWorkflow.workflowId, updateData);
} catch (error) {
if (error instanceof Error) {
return res.status(400).json({ message: error.message });
}
}
if (sharedWorkflow.workflow.active) {
try {