Updates webhook UUIDs to a new one when duplicating

This commit is contained in:
Omar Ajoue 2021-08-18 16:25:05 +02:00
parent 967aabbf55
commit 86fa3a6b9e

View file

@ -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});