Skip to content

Commit 303e0c1

Browse files
committed
refactor(api): enforce dynamic rendering and improve TypeScript compatibility in GET request for schema retrieval
1 parent 94307b9 commit 303e0c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/api/get-schema/[name]/route.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ function isValidSchemaObject(value: unknown): value is Record<string, unknown> {
2424
return typeof value === 'object' && value !== null && !Array.isArray(value);
2525
}
2626

27+
// Force dynamic rendering to avoid prerender errors
28+
export const dynamic = "force-dynamic";
29+
export const fetchCache = "force-no-store";
30+
2731
// Use the simplest form for Next.js 15 compatibility
28-
export async function GET(request, context) {
32+
// Type the parameters with any to satisfy TypeScript without conflicting with Next.js
33+
export async function GET(request: any, context: any) {
2934
// Extract schema name from URL params
3035
const schemaName = context.params.name;
3136

@@ -97,7 +102,4 @@ export async function GET(request, context) {
97102
{ status: 500 }
98103
);
99104
}
100-
}
101-
102-
// Ensure this route is always dynamic and not cached
103-
export const dynamic = "force-dynamic";
105+
}

0 commit comments

Comments
 (0)