fix build error

This commit is contained in:
RandyJC
2025-12-08 15:49:34 +01:00
parent 650e8f2366
commit 8403c6a7c3

View File

@@ -4,14 +4,13 @@ import { NextRequest, NextResponse } from "next/server"
export const runtime = "nodejs" export const runtime = "nodejs"
export const dynamic = "force-dynamic" export const dynamic = "force-dynamic"
type RouteContext = { export async function DELETE(
params?: Promise<Record<string, string | string[] | undefined>> _request: NextRequest,
} context: { params: Promise<{ file: string }> },
) {
export async function DELETE(_request: NextRequest, context: RouteContext) {
try { try {
const params = context.params ? await context.params : undefined const params = await context.params
const fileParam = Array.isArray(params?.file) ? params?.file[0] : params?.file const fileParam = params.file
if (!fileParam) { if (!fileParam) {
return NextResponse.json({ error: "Missing file parameter" }, { status: 400 }) return NextResponse.json({ error: "Missing file parameter" }, { status: 400 })