mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
Adjustments suggested by @mutdmour
This commit is contained in:
parent
82dbbcd2e0
commit
3b73cb6a56
|
@ -109,7 +109,7 @@ export default mixins(showMessage, workflowHelpers).extend({
|
||||||
|
|
||||||
this.$data.isSaving = true;
|
this.$data.isSaving = true;
|
||||||
|
|
||||||
const saved = await this.saveAsNewWorkflow({name, tags: this.currentTagIds, updateWebhookUrls: true});
|
const saved = await this.saveAsNewWorkflow({name, tags: this.currentTagIds, resetWebhookUrls: true});
|
||||||
|
|
||||||
if (saved) {
|
if (saved) {
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
|
|
|
@ -436,18 +436,19 @@ export const workflowHelpers = mixins(
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async saveAsNewWorkflow ({name, tags, updateWebhookUrls}: {name?: string, tags?: string[], updateWebhookUrls?: boolean} = {}): Promise<boolean> {
|
async saveAsNewWorkflow ({name, tags, resetWebhookUrls}: {name?: string, tags?: string[], resetWebhookUrls?: boolean} = {}): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
this.$store.commit('addActiveAction', 'workflowSaving');
|
this.$store.commit('addActiveAction', 'workflowSaving');
|
||||||
|
|
||||||
const workflowDataRequest: IWorkflowDataUpdate = await this.getWorkflowDataToSave();
|
const workflowDataRequest: IWorkflowDataUpdate = await this.getWorkflowDataToSave();
|
||||||
// make sure that the new ones are not active
|
// make sure that the new ones are not active
|
||||||
workflowDataRequest.active = false;
|
workflowDataRequest.active = false;
|
||||||
if (updateWebhookUrls) {
|
if (resetWebhookUrls) {
|
||||||
workflowDataRequest.nodes!.forEach(node => {
|
workflowDataRequest.nodes = workflowDataRequest.nodes!.map(node => {
|
||||||
if (node.webhookId) {
|
if (node.webhookId) {
|
||||||
node.webhookId = uuidv4();
|
node.webhookId = uuidv4();
|
||||||
}
|
}
|
||||||
|
return node;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue