File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { AppRouteRequestHandlerOptions } from '.';
66import { RPCApiHandler } from '../api' ;
77import { loadAssets } from '../shared' ;
88
9- type Context = { params : { path : string [ ] } } ;
9+ type Context = { params : Promise < { path : string [ ] } > } ;
1010
1111/**
1212 * Creates a Next.js 13 "app dir" API route request handler which encapsulates Prisma CRUD operations.
@@ -28,17 +28,18 @@ export default function factory(
2828 }
2929
3030 const url = new URL ( req . url ) ;
31+ const params = await context . params ;
3132 const query = Object . fromEntries ( url . searchParams ) ;
3233
33- if ( ! context . params . path ) {
34+ if ( ! params . path ) {
3435 return NextResponse . json (
3536 { message : 'missing path parameter' } ,
3637 {
3738 status : 400 ,
3839 }
3940 ) ;
4041 }
41- const path = context . params . path . join ( '/' ) ;
42+ const path = params . path . join ( '/' ) ;
4243
4344 let requestBody : unknown ;
4445 if ( req . body ) {
You can’t perform that action at this time.
0 commit comments