From 86fa3a6b9e58ae7c17d03929ab55e161dcddabcb Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Wed, 18 Aug 2021 16:25:05 +0200 Subject: [PATCH] Updates webhook UUIDs to a new one when duplicating --- .../editor-ui/src/components/DuplicateWorkflowDialog.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue b/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue index 839e00efac..d24776a60e 100644 --- a/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue +++ b/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue @@ -44,6 +44,8 @@ import { workflowHelpers } from "@/components/mixins/workflowHelpers"; import { showMessage } from "@/components/mixins/showMessage"; import TagsDropdown from "@/components/TagsDropdown.vue"; import Modal from "./Modal.vue"; +import { v4 as uuidv4} from 'uuid'; +import { INodeUi } from "../Interface"; export default mixins(showMessage, workflowHelpers).extend({ components: { TagsDropdown, Modal }, @@ -107,6 +109,13 @@ export default mixins(showMessage, workflowHelpers).extend({ return; } + const allNodes = this.$store.getters.allNodes; + allNodes.forEach((node: INodeUi) => { + if (node.webhookId) { + node.webhookId = uuidv4(); + } + }); + this.$data.isSaving = true; const saved = await this.saveAsNewWorkflow({name, tags: this.currentTagIds});