diff --git a/frontend/src/app/api/[...path]/route.ts b/frontend/src/app/api/[...path]/route.ts index e72a6b06..27912005 100644 --- a/frontend/src/app/api/[...path]/route.ts +++ b/frontend/src/app/api/[...path]/route.ts @@ -3,30 +3,34 @@ import { NextRequest, NextResponse } from 'next/server'; // This catch-all API route proxies all /api/* requests to the backend export async function GET( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { - return proxyToBackend(request, params.path); + const { path } = await params; + return proxyToBackend(request, path); } export async function POST( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { - return proxyToBackend(request, params.path); + const { path } = await params; + return proxyToBackend(request, path); } export async function PUT( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { - return proxyToBackend(request, params.path); + const { path } = await params; + return proxyToBackend(request, path); } export async function DELETE( request: NextRequest, - { params }: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { - return proxyToBackend(request, params.path); + const { path } = await params; + return proxyToBackend(request, path); } async function proxyToBackend(request: NextRequest, pathSegments: string[]) {