diff --git a/front-end-dash.aggios.app/app/api/[...path]/route.ts b/front-end-dash.aggios.app/app/api/[...path]/route.ts index 03c50c8..2ab120b 100644 --- a/front-end-dash.aggios.app/app/api/[...path]/route.ts +++ b/front-end-dash.aggios.app/app/api/[...path]/route.ts @@ -1,7 +1,8 @@ import { NextRequest, NextResponse } from "next/server"; -export async function GET(req: NextRequest, { params }: { params: { path: string[] } }) { - const path = params.path?.join("/") || ""; +export async function GET(req: NextRequest, { params }: { params: Promise<{ path: string[] }> }) { + const { path: pathArray } = await params; + const path = pathArray?.join("/") || ""; const token = req.headers.get("authorization"); const host = req.headers.get("host"); @@ -24,8 +25,9 @@ export async function GET(req: NextRequest, { params }: { params: { path: string } } -export async function PUT(req: NextRequest, { params }: { params: { path: string[] } }) { - const path = params.path?.join("/") || ""; +export async function PUT(req: NextRequest, { params }: { params: Promise<{ path: string[] }> }) { + const { path: pathArray } = await params; + const path = pathArray?.join("/") || ""; const token = req.headers.get("authorization"); const host = req.headers.get("host"); const body = await req.json(); @@ -50,8 +52,9 @@ export async function PUT(req: NextRequest, { params }: { params: { path: string } } -export async function POST(req: NextRequest, { params }: { params: { path: string[] } }) { - const path = params.path?.join("/") || ""; +export async function POST(req: NextRequest, { params }: { params: Promise<{ path: string[] }> }) { + const { path: pathArray } = await params; + const path = pathArray?.join("/") || ""; const token = req.headers.get("authorization"); const host = req.headers.get("host"); const body = await req.json(); @@ -74,4 +77,4 @@ export async function POST(req: NextRequest, { params }: { params: { path: strin console.error("API proxy error:", error); return NextResponse.json({ error: "Internal Server Error" }, { status: 500 }); } -} +} \ No newline at end of file