Raised upload to 150MB
X-Lovable-Edit-ID: edt-a6a5e64c-fbb8-4407-88b7-3ac8fc986232 Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
|
||||
const MAX_BYTES = 50 * 1024 * 1024;
|
||||
const MAX_BYTES = 150 * 1024 * 1024;
|
||||
|
||||
export function CaseDocumentsTab({ caseId }: { caseId: string }) {
|
||||
const { user } = useAuth();
|
||||
@@ -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; }
|
||||
|
||||
@@ -1046,3 +1046,12 @@ const rootRouteChildren: RootRouteChildren = {
|
||||
export const routeTree = rootRouteImport
|
||||
._addFileChildren(rootRouteChildren)
|
||||
._addFileTypes<FileRouteTypes>()
|
||||
|
||||
import type { getRouter } from './router.tsx'
|
||||
import type { createStart } from '@tanstack/react-start'
|
||||
declare module '@tanstack/react-start' {
|
||||
interface Register {
|
||||
ssr: true
|
||||
router: Awaited<ReturnType<typeof getRouter>>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE storage.buckets SET file_size_limit = 157286400 WHERE id IN ('case-documents', 'case-receipts', 'case-reports', 'generated-documents', 'message-attachments');
|
||||
Reference in New Issue
Block a user