diff --git a/src/common/constants.ts b/src/common/constants.ts index 2e076d4d7..50b7d270b 100644 --- a/src/common/constants.ts +++ b/src/common/constants.ts @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +const apiVersion = "v2.1-preview.1"; + /** * Constants used throughout application */ @@ -22,9 +24,7 @@ export const constants = { convertedImageQuality: 0.7, convertedThumbnailQuality: 0.2, - apiModelsPath: "/formrecognizer/v2.0-preview/custom/models", - apiPreviewPath: "/formrecognizer/v2.1-preview.1/custom/models", - apiPreviewComposePath: "/formrecognizer/v2.1-preview.1/custom/models/compose", + apiModelsPath: `/formrecognizer/${apiVersion}/custom/models`, pdfjsWorkerSrc(version: string) { return `//fotts.azureedge.net/npm/pdfjs-dist/${version}/pdf.worker.js`; diff --git a/src/react/components/pages/modelCompose/modelCompose.tsx b/src/react/components/pages/modelCompose/modelCompose.tsx index ce056113a..63b7137dc 100644 --- a/src/react/components/pages/modelCompose/modelCompose.tsx +++ b/src/react/components/pages/modelCompose/modelCompose.tsx @@ -364,7 +364,7 @@ export default class ModelComposePage extends React.Component { models.forEach(async (m) => { if (m.status !== "ready" && m.status !== "invalid") { - const url = constants.apiPreviewPath + "/" + m.modelId; + const url = constants.apiModelsPath + "/" + m.modelId; const newModel = await this.getComposeModelByURl(url); const newStatus = newModel.status; m.status = newStatus; @@ -487,7 +487,7 @@ export default class ModelComposePage extends React.Component { const baseURL = url.resolve( this.props.project.apiUriBase, - constants.apiPreviewPath, + constants.apiModelsPath, ); const provider = this.props.project.sourceConnection.providerOptions as any; const trainSourceURL = provider.sas;