Skip to content

Commit 28b130f

Browse files
authored
fix(server): change nextjs adapter's context params to be Promise to satisfy Next15's linter (#1809)
1 parent 35ea74f commit 28b130f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/server/src/next/app-route-handler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { AppRouteRequestHandlerOptions } from '.';
66
import { RPCApiHandler } from '../api';
77
import { loadAssets } from '../shared';
88

9-
type Context = { params: Promise<{ path: string[] }> | { path: string[] } };
9+
type Context = { params: Promise<{ path: string[] }> };
1010

1111
/**
12-
* Creates a Next.js 13 "app dir" API route request handler which encapsulates Prisma CRUD operations.
12+
* Creates a Next.js "app dir" API route request handler which encapsulates Prisma CRUD operations.
1313
*
1414
* @remarks Since Next.js 15, `context.params` is asynchronous and must be awaited.
1515
* @param options Options for initialization
@@ -28,7 +28,7 @@ export default function factory(
2828
return NextResponse.json({ message: 'unable to get prisma from request context' }, { status: 500 });
2929
}
3030

31-
let params: Context['params'];
31+
let params: Awaited<Context['params']>;
3232
const url = new URL(req.url);
3333
const query = Object.fromEntries(url.searchParams);
3434

0 commit comments

Comments
 (0)