diff options
Diffstat (limited to 'server/sonar-web/src/main/js/api/report.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/report.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/api/report.ts b/server/sonar-web/src/main/js/api/report.ts index 6d0afee2cf2..e9e933d24ad 100644 --- a/server/sonar-web/src/main/js/api/report.ts +++ b/server/sonar-web/src/main/js/api/report.ts @@ -19,6 +19,7 @@ */ import { getJSON, post } from 'sonar-ui-common/helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; +import { getBaseUrl } from '../helpers/system'; export interface ReportStatus { canDownload?: boolean; @@ -35,11 +36,9 @@ export function getReportStatus(component: string): Promise<ReportStatus> { } export function getReportUrl(component: string): string { - return ( - (window as any).baseUrl + - '/api/governance_reports/download?componentKey=' + - encodeURIComponent(component) - ); + return `${getBaseUrl()}/api/governance_reports/download?componentKey=${encodeURIComponent( + component + )}`; } export function subscribe(component: string): Promise<void | Response> { |