Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
b7e7fdb90c
commit
85cec35428
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user