From e96f0bbd0ad7412b30b976ecd797c9eeb1c2e59a Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:25:26 -0700 Subject: [PATCH] fix(server): change nextjs adapter's context params to be Promise to satisfy Next15's linter --- packages/server/src/next/app-route-handler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/next/app-route-handler.ts b/packages/server/src/next/app-route-handler.ts index 8347c5eb0..d0894a816 100644 --- a/packages/server/src/next/app-route-handler.ts +++ b/packages/server/src/next/app-route-handler.ts @@ -6,10 +6,10 @@ import { AppRouteRequestHandlerOptions } from '.'; import { RPCApiHandler } from '../api'; import { loadAssets } from '../shared'; -type Context = { params: Promise<{ path: string[] }> | { path: string[] } }; +type Context = { params: Promise<{ path: string[] }> }; /** - * Creates a Next.js 13 "app dir" API route request handler which encapsulates Prisma CRUD operations. + * Creates a Next.js "app dir" API route request handler which encapsulates Prisma CRUD operations. * * @remarks Since Next.js 15, `context.params` is asynchronous and must be awaited. * @param options Options for initialization @@ -28,7 +28,7 @@ export default function factory( return NextResponse.json({ message: 'unable to get prisma from request context' }, { status: 500 }); } - let params: Context['params']; + let params: Awaited; const url = new URL(req.url); const query = Object.fromEntries(url.searchParams);