mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
fix build error
This commit is contained in:
@@ -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 })
|
||||||
|
|||||||
Reference in New Issue
Block a user