diff --git a/forms-flow-web/src/apiManager/services/FormServices.js b/forms-flow-web/src/apiManager/services/FormServices.js index f81ed427b..fb7a8ae9e 100644 --- a/forms-flow-web/src/apiManager/services/FormServices.js +++ b/forms-flow-web/src/apiManager/services/FormServices.js @@ -26,8 +26,7 @@ export const formUpdate = (form_id,formData) => { }; export const processMigrate = (migrationData) => { - const migrationUrl = replaceUrl(API.PROCESS_MIGRATE); - return RequestService.httpPOSTRequest(migrationUrl, migrationData ); + return RequestService.httpPOSTRequest(API.PROCESS_MIGRATE, migrationData ); }; diff --git a/forms-flow-web/src/apiManager/services/processServices.js b/forms-flow-web/src/apiManager/services/processServices.js index 81c3e2465..a18630480 100644 --- a/forms-flow-web/src/apiManager/services/processServices.js +++ b/forms-flow-web/src/apiManager/services/processServices.js @@ -298,14 +298,15 @@ export const getFormProcesses = (formId, ...rest) => { export const getProcessDetails = (processKey, tenant_key = null, mapperId = null) => { const api = API.GET_PROCESS_XML; let url = replaceUrl(api, "", processKey); - // Append tenant_key if available - if (tenant_key) { - url += `?tenantId=${tenant_key}`; - } - // Append mapperId if available - if (mapperId) { - url += tenant_key ? `&mapperId=${mapperId}` : `?mapperId=${mapperId}`; + + const params = []; + if (tenant_key) params.push(`tenantId=${tenant_key}`); + if (mapperId) params.push(`mapperId=${mapperId}`); + + if (params.length) { + url += `?${params.join("&")}`; } + return RequestService.httpGETRequest(url); }; diff --git a/forms-flow-web/src/components/Form/EditForm/FlowEdit.js b/forms-flow-web/src/components/Form/EditForm/FlowEdit.js index 1ca5eb3c6..11323f597 100644 --- a/forms-flow-web/src/components/Form/EditForm/FlowEdit.js +++ b/forms-flow-web/src/components/Form/EditForm/FlowEdit.js @@ -143,6 +143,7 @@ const FlowEdit = forwardRef(({ isPublished = false, CategoryType, fetchHistories({ parentProcessKey: processData.parentProcessKey }); }; const handleSaveFlowClick = () => { + //On clicking the save flow it checks if the current flow has already been migrated, if not, it tries to migrate first. if (shouldShowMigrationModal()) { setShowMigrationModal(true); } else {