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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user