From 03b91da2b2eb1fd7745fe109febf759f2e3c353f Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 27 Nov 2024 15:08:18 +0300 Subject: [PATCH] Add window location to dataset url --- package.json | 2 +- src/api/datasets.ts | 4 ++-- src/components/GalaxyCharts.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 42a506d..7d73e05 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "charts" ], "license": "MIT", - "version": "0.0.38", + "version": "0.0.39", "type": "module", "main": "./dist/galaxy-charts.umd.cjs", "module": "./dist/galaxy-charts.js", diff --git a/src/api/datasets.ts b/src/api/datasets.ts index 5596cdb..de77e5c 100644 --- a/src/api/datasets.ts +++ b/src/api/datasets.ts @@ -27,6 +27,6 @@ export async function datasetsGetColumns(datasetId: string, columnList: string[] } } -export function datasetsGetUrl(datasetId: string): string { - return `/api/datasets/${datasetId}/display`; +export function datasetsGetUrl(root: string, datasetId: string): string { + return `${window.location.origin}${root}api/datasets/${datasetId}/display`; } diff --git a/src/components/GalaxyCharts.vue b/src/components/GalaxyCharts.vue index 7118911..eb181bc 100644 --- a/src/components/GalaxyCharts.vue +++ b/src/components/GalaxyCharts.vue @@ -67,7 +67,7 @@ if (visualizationConfig.dataset_url) { if (!datasetId) { errorMessage.value = "Visualization requires `dataset_id` or `dataset_url`."; } else { - datasetUrl.value = datasetsGetUrl(datasetId); + datasetUrl.value = datasetsGetUrl(root, datasetId); console.debug(`GalaxyCharts: Built dataset url from dataset id: ${datasetUrl.value}.`); } }