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')} /> ); })}