fix: garden ui polish - form styles, back nav, species dropdown, upload limit
This commit is contained in:
@@ -4,8 +4,13 @@ import { getCurrentSession } from "@/lib/session";
|
||||
import { ensureBucket, minioClient, MINIO_BUCKET } from "@/lib/minio";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
export const maxDuration = 60;
|
||||
|
||||
const MAX_FILE_SIZE = 5 * 1024 * 1024;
|
||||
export const config = {
|
||||
api: { bodyParser: { sizeLimit: "100mb" } },
|
||||
};
|
||||
|
||||
const MAX_FILE_SIZE = 100 * 1024 * 1024;
|
||||
|
||||
export async function POST(request: Request) {
|
||||
let session: Awaited<ReturnType<typeof getCurrentSession>>;
|
||||
@@ -49,8 +54,15 @@ export async function POST(request: Request) {
|
||||
"Content-Type": file.type,
|
||||
});
|
||||
} catch (err) {
|
||||
const msg = err instanceof Error ? err.message : String(err);
|
||||
console.error("Upload failed", err);
|
||||
return NextResponse.json({ error: "Upload service unavailable" }, { status: 503 });
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: "Upload service unavailable",
|
||||
detail: process.env.NODE_ENV !== "production" ? msg : undefined,
|
||||
},
|
||||
{ status: 503 },
|
||||
);
|
||||
}
|
||||
|
||||
return NextResponse.json({ url: `/api/uploads/${key}` });
|
||||
|
||||
Reference in New Issue
Block a user