From d5037b35a93a729f8fab8ac27f10bb90940d0893 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Tue, 28 Oct 2025 08:08:57 -0600 Subject: [PATCH] Fix TypeScript error: params must be Promise in Next.js 15 --- frontend/src/app/api/[...path]/route.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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[]) {