fix: garden ui polish - form styles, back nav, species dropdown, upload limit

This commit is contained in:
ginnoir
2026-06-01 23:38:52 -05:00
parent 6b25d67537
commit dd980c6932
6 changed files with 115 additions and 6 deletions
+14 -2
View File
@@ -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}` });