From ca6999099afce22ee84c9f6840abc831dc79c935 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:32:11 +0200 Subject: [PATCH 1/3] Refactor dataset services (fix TODOs) Use directly dataset API routes instead of history contents routes to avoid having to pass a history ID that is unnecessary. --- client/src/components/Dataset/services.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/src/components/Dataset/services.ts b/client/src/components/Dataset/services.ts index b908138753fb..50ba6a2597b8 100644 --- a/client/src/components/Dataset/services.ts +++ b/client/src/components/Dataset/services.ts @@ -67,13 +67,11 @@ export async function updateTags( } export function getCompositeDatasetLink(historyDatasetId: string, path: string) { - // TODO: historyDatasetId is wrong here, we should expose the route without forcing to provide a history id - return withPrefix(`/api/histories/${historyDatasetId}/contents/${historyDatasetId}/display?filename=${path}`); + return withPrefix(`/api/datasets/${historyDatasetId}/display?filename=${path}`); } -const getDataset = fetcher.path("/api/histories/{history_id}/contents/{id}").method("get").create(); +const getDataset = fetcher.path("/api/datasets/{dataset_id}").method("get").create(); export async function getCompositeDatasetInfo(id: string) { - // TODO: ${id} as history id is wrong here, we should expose the route without forcing to provide a history id - const { data } = await getDataset({ history_id: id, id }); + const { data } = await getDataset({ dataset_id: id }); return data; } From eb0c5acf84fb7a85d52240aa1ca8823189506a09 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:43:55 +0200 Subject: [PATCH 2/3] Rename getCompositeDatasetInfo to getDatasetDetails There is nothing particularly "composite" related about it. --- client/src/components/Dataset/DatasetLink/DatasetLink.vue | 4 ++-- client/src/components/Dataset/services.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/Dataset/DatasetLink/DatasetLink.vue b/client/src/components/Dataset/DatasetLink/DatasetLink.vue index 7fb1d5974d44..52a5c2eaab8b 100644 --- a/client/src/components/Dataset/DatasetLink/DatasetLink.vue +++ b/client/src/components/Dataset/DatasetLink/DatasetLink.vue @@ -5,7 +5,7 @@