Skip to content

Commit

Permalink
fix(public-api): Fix error updating workflow with property not define…
Browse files Browse the repository at this point in the history
…d in the schema (#4089)

* fix(cli): catch errors on updating workflow

* ⚡ Don\'t allow additionalProperties in the workflow schema

Co-authored-by: ricardo <[email protected]>
  • Loading branch information
mieky and RicardoE105 authored Sep 14, 2022
1 parent b2807ce commit f40ae50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
additionalProperties: false
required:
- name
- nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f40ae50

Please sign in to comment.