Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/server/src/next/app-route-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<Context['params']>;
const url = new URL(req.url);
const query = Object.fromEntries(url.searchParams);

Expand Down
Loading