mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
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:
parent
b2807cecb3
commit
f40ae501b4
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue