diff --git a/apps/website/src/app/docAPI.ts b/apps/website/src/app/docAPI.ts
index 863468445..be08ff226 100644
--- a/apps/website/src/app/docAPI.ts
+++ b/apps/website/src/app/docAPI.ts
@@ -32,18 +32,20 @@ export const fetchModelJSON = async (packageName: string, version: string) => {
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
try {
- const { rows } = await sql`select data from documentation where name = ${packageName} and version = ${'main'}`;
+ const { rows } = await sql`select url from documentation where name = ${packageName} and version = ${'main'}`;
+ const res = await fetch(rows[0]?.url ?? '');
- return rows[0]?.data ?? null;
+ return await res.json();
} catch {
return null;
}
}
try {
- const { rows } = await sql`select data from documentation where name = ${packageName} and version = ${version}`;
+ const { rows } = await sql`select url from documentation where name = ${packageName} and version = ${version}`;
+ const res = await fetch(rows[0]?.url ?? '');
- return rows[0]?.data ?? null;
+ return await res.json();
} catch {
return null;
}
diff --git a/apps/website/src/components/PackageSelect.tsx b/apps/website/src/components/PackageSelect.tsx
index b84d6aa6f..7ef48cd8b 100644
--- a/apps/website/src/components/PackageSelect.tsx
+++ b/apps/website/src/components/PackageSelect.tsx
@@ -14,11 +14,10 @@ export default function PackageSelect() {
const packageMenu = useMenuState({ gutter: 8, sameWidth: true, fitViewport: true });
- // TODO: Version number is currently hard coded
const packageMenuItems = useMemo(
() =>
PACKAGES.map((pkg, idx) => (
-
+