Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-22 17:35:49 +00:00
co-authored by renee-png
parent b7e7fdb90c
commit 85cec35428
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ export function CaseDocumentsTab({ caseId }: { caseId: string }) {
const sanitizeName = (n: string) => n.replace(/[^a-zA-Z0-9._-]/g, "_");
const uploadFile = async (file: File, folderPath: string) => {
if (file.size > MAX_BYTES) { toast.error(`${file.name}: too large (50MB max)`); return false; }
if (file.size > MAX_BYTES) { toast.error(`${file.name}: too large (150MB max)`); return false; }
const storagePath = `${caseId}/${Date.now()}-${Math.random().toString(36).slice(2, 6)}-${sanitizeName(file.name)}`;
const { error: upErr } = await supabase.storage.from("case-documents").upload(storagePath, file);
if (upErr) { toast.error(`${file.name}: upload failed`, { description: upErr.message }); return false; }