diff --git a/frontend/src/lib/components/apps/components/inputs/AppS3FileInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppS3FileInput.svelte index 7064449e6a..002ec519fb 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppS3FileInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppS3FileInput.svelte @@ -34,7 +34,7 @@ } let fileUploads: Writable = writable([]) - const { app, worldStore, componentControl, runnableComponents } = + const { app, worldStore, componentControl, runnableComponents, workspace } = getContext('AppViewerContext') $componentControl[id] = { @@ -124,6 +124,7 @@ customResourceType="s3" customClass={css?.container?.class} customStyle={css?.container?.style} + {workspace} on:addition={(evt) => { const curr = outputs.result.peak() outputs.result.set(curr.concat(evt.detail)) diff --git a/frontend/src/lib/components/common/fileUpload/FileUpload.svelte b/frontend/src/lib/components/common/fileUpload/FileUpload.svelte index 14228b6b78..507bf8b6a7 100644 --- a/frontend/src/lib/components/common/fileUpload/FileUpload.svelte +++ b/frontend/src/lib/components/common/fileUpload/FileUpload.svelte @@ -23,6 +23,7 @@ export let pathTransformer: any = undefined // function taking as input {file: File} and returning a string export let forceDisplayUploads: boolean = false export let defaultValue: string | undefined = undefined + export let workspace: string | undefined = undefined const dispatch = createEventDispatcher() @@ -154,7 +155,7 @@ }) xhr?.open( 'POST', - `/api/w/${$workspaceStore}/job_helpers/upload_s3_file?${params.toString()}`, + `/api/w/${workspace ?? $workspaceStore}/job_helpers/upload_s3_file?${params.toString()}`, true ) xhr?.setRequestHeader('Content-Type', 'application/octet-stream') @@ -189,7 +190,7 @@ async function deleteFile(fileKey: string) { await HelpersService.deleteS3File({ - workspace: $workspaceStore!, + workspace: workspace ?? $workspaceStore!, fileKey: fileKey }) dispatch('deletion', { path: fileKey })