mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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
|
type: object
|
||||||
|
additionalProperties: false
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- nodes
|
- nodes
|
||||||
|
|
|
@ -198,7 +198,13 @@ export = {
|
||||||
await workflowRunner.remove(id.toString());
|
await workflowRunner.remove(id.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
await updateWorkflow(sharedWorkflow.workflowId, updateData);
|
await updateWorkflow(sharedWorkflow.workflowId, updateData);
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
return res.status(400).json({ message: error.message });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (sharedWorkflow.workflow.active) {
|
if (sharedWorkflow.workflow.active) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue