Skip to content

Commit ac545ce

Browse files
committed
Fix(api): Correct type annotation for GET route handler parameters
1 parent 5b01b65 commit ac545ce

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/api/schemas/[name]/route.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ import path from "path";
44
import jsonc from "jsonc";
55

66
// Define the expected structure of the context parameter
7-
interface GetContext {
8-
params: {
9-
name: string;
10-
};
11-
}
7+
// Remove the custom GetContext interface
8+
// interface GetContext {
9+
// params: {
10+
// name: string;
11+
// };
12+
// }
1213

1314
export async function GET(
1415
_request: Request, // Prefix with _ if not used
15-
{ params }: GetContext, // Use the defined interface
16+
// Use the standard Next.js context typing for route parameters
17+
{ params }: { params: { name: string } },
1618
) {
1719
console.log("[API /api/schemas/[name]] Waiting for params...");
1820

0 commit comments

Comments
 (0)