From 0062af2344009fd88b84f96eef8a2e63eb8d1ae0 Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Wed, 13 Nov 2024 12:47:59 -0500 Subject: [PATCH] Cleanup code --- src/lib/components/explorer/export/ExportStepper.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/explorer/export/ExportStepper.svelte b/src/lib/components/explorer/export/ExportStepper.svelte index 318086f7..945e9ca5 100644 --- a/src/lib/components/explorer/export/ExportStepper.svelte +++ b/src/lib/components/explorer/export/ExportStepper.svelte @@ -173,12 +173,11 @@ return 'ERROR'; } - async function getSignedUrl(urlTemplate: string) { + async function getSignedUrl() { const path = 'picsure/query/' + datasetId + '/signed-url'; try { const res = await api.post(path, query); - let url = urlTemplate + encodeURIComponent(res.signedUrl); - window.open(url); + return res.signedUrl; } catch (error) { console.error('Error in getSignedUrl', error); } @@ -206,7 +205,8 @@ async function exportToTerra() { exportLoading = true; - await getSignedUrl("https://app.terra.bio/#import-data?format=pfb&url="); + let signedUrl = await getSignedUrl(); + window.open("https://app.terra.bio/#import-data?format=pfb&url=" + encodeURIComponent(signedUrl)); exportLoading = false; }