@@ -24,12 +24,13 @@ type RouteContext = {
2424} ;
2525
2626export async function GET ( _request : Request , context : RouteContext ) {
27- const params = await context . params ;
2827 const session = await auth ( ) ;
2928 if ( ! session ) {
3029 return NextResponse . json ( { error : "Unauthorized" } , { status : 401 } ) ;
3130 }
3231
32+ const params = await context . params ;
33+
3334 try {
3435 const parsedId = idSchema . safeParse ( params . id ) ;
3536
@@ -58,12 +59,13 @@ export async function GET(_request: Request, context: RouteContext) {
5859}
5960
6061export async function PUT ( request : Request , context : RouteContext ) {
61- const params = await context . params ;
6262 const session = await auth ( ) ;
6363 if ( ! session ) {
6464 return NextResponse . json ( { error : "Unauthorized" } , { status : 401 } ) ;
6565 }
6666
67+ const params = await context . params ;
68+
6769 try {
6870 const parsedId = idSchema . safeParse ( params . id ) ;
6971 const parsedBody = teamMemberUpdateSchema . safeParse ( await request . json ( ) ) ;
@@ -99,12 +101,13 @@ export async function PUT(request: Request, context: RouteContext) {
99101}
100102
101103export async function DELETE ( _request : Request , context : RouteContext ) {
102- const params = await context . params ;
103104 const session = await auth ( ) ;
104105 if ( ! session ) {
105106 return NextResponse . json ( { error : "Unauthorized" } , { status : 401 } ) ;
106107 }
107108
109+ const params = await context . params ;
110+
108111 try {
109112 const parsedId = idSchema . safeParse ( params . id ) ;
110113
0 commit comments