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 18:40:45 +03:00 committed by GitHub
parent b2807cecb3
commit f40ae501b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -1,4 +1,5 @@
type: object
additionalProperties: false
required:
- name
- nodes

View file

@ -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 {