File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
app/api/get-schema/[name] Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ import { NextResponse, NextRequest } from "next/server";
22import fs from "fs/promises" ;
33import path from "path" ;
44
5- // Explicitly define the type for the context parameter
6- interface RouteContext {
7- params : {
8- name : string ;
9- } ;
10- }
5+ // Remove unused interface definition
6+ // interface RouteContext {
7+ // params: {
8+ // name: string;
9+ // };
10+ // }
1111
1212// Helper function to safely join paths and prevent traversal
1313function safeJoin ( base : string , target : string ) : string | null {
@@ -20,12 +20,12 @@ function safeJoin(base: string, target: string): string | null {
2020 return null ; // Path traversal detected or invalid path
2121}
2222
23-
2423export async function GET (
25- request : NextRequest ,
26- context : RouteContext // Use the explicitly defined type
24+ // Remove the request parameter as it's unused
25+ // request: NextRequest,
26+ { params } : { params : { name : string } } // Use standard destructuring for the context/params
2727) {
28- const schemaName = context . params . name ;
28+ const schemaName = params . name ; // Access name via params
2929
3030 if ( ! schemaName ) {
3131 return NextResponse . json ( { error : "Schema name required" } , { status : 400 } ) ;
You can’t perform that action at this time.
0 commit comments