fix(editor): Fix route component caching, incorrect use of array reduce method and enable WF history feature (#7434)

Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
Csaba Tuncsik
2023-10-26 20:47:42 +02:00
committed by GitHub
parent ae616f146b
commit 12a89e6d14
13 changed files with 211 additions and 23 deletions

View File

@@ -90,7 +90,13 @@ export const useWorkflowHistoryStore = defineStore('workflowHistory', () => {
updateData.active = false;
}
return workflowsStore.updateWorkflow(workflowId, updateData, true);
return workflowsStore.updateWorkflow(workflowId, updateData, true).catch(async (error) => {
if (error.httpStatusCode === 400 && error.message.includes('can not be activated')) {
return workflowsStore.fetchWorkflow(workflowId);
} else {
throw new Error(error);
}
});
};
return {