From 413431507620e6558bf5cde0a4ad6bca768328af Mon Sep 17 00:00:00 2001 From: gbuomprisco Date: Tue, 22 Oct 2024 15:08:17 +0800 Subject: [PATCH] Convert enhanceRouteHandler params into a Promise-based Dynamic API --- packages/next/src/routes/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/src/routes/index.ts b/packages/next/src/routes/index.ts index f7669b8fa..eb27c2670 100644 --- a/packages/next/src/routes/index.ts +++ b/packages/next/src/routes/index.ts @@ -72,7 +72,7 @@ export const enhanceRouteHandler = < return async function routeHandler( request: NextRequest, routeParams: { - params: Record; + params: Promise>; }, ) { type UserParam = Params['auth'] extends false ? undefined : User; @@ -126,7 +126,7 @@ export const enhanceRouteHandler = < request, body, user, - params: routeParams.params, + params: await routeParams.params, }); }; };