From 85625f4d95c531ffd28add9f9b4b5188facc88e3 Mon Sep 17 00:00:00 2001 From: Krao Hasanee Date: Tue, 2 Jun 2026 23:59:34 -0400 Subject: [PATCH] fix: delivery zip downloads from correct deliveries storage bucket Co-Authored-By: Claude Sonnet 4.6 --- src/pages/TaskDetail.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/TaskDetail.jsx b/src/pages/TaskDetail.jsx index b132524..60e7bb4 100644 --- a/src/pages/TaskDetail.jsx +++ b/src/pages/TaskDetail.jsx @@ -414,7 +414,7 @@ export default function TaskDetail() { setComments(prev => prev.filter(c => c.id !== commentId)); }; - const downloadAllFiles = async (files, label = 'files') => { + const downloadAllFiles = async (files, label = 'files', bucket = 'submissions') => { if (downloading) return; setDownloading('all'); setDlProgress({ active: true, label: 'Preparing…', percent: 0 }); @@ -424,7 +424,7 @@ export default function TaskDetail() { const file = files[i]; setDlProgress({ active: true, label: file.name, percent: Math.round((i / (files.length + 1)) * 100) }); try { - const { data } = await supabase.storage.from('submissions').createSignedUrl(file.storage_path, 3600, { download: file.name }); + const { data } = await supabase.storage.from(bucket).createSignedUrl(file.storage_path, 3600, { download: file.name }); if (data?.signedUrl) { const response = await fetch(data.signedUrl); if (response.ok) zip.file(file.name, await response.blob()); @@ -693,7 +693,7 @@ export default function TaskDetail() { :
No notes provided.
} - downloadAllFiles(f, `Submission ${i + 1}`)} /> + downloadAllFiles(f, `Submission ${i + 1}`, 'deliveries')} /> ); })}