Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Redirect to API report when there are 0 reports (#28145)

Jordi Enricfe8aec6070f0
diff --git a/apps/studio/pages/project/[ref]/reports/index.tsx b/apps/studio/pages/project/[ref]/reports/index.tsx
index f21553199bb..81e08b532af 100644
--- a/apps/studio/pages/project/[ref]/reports/index.tsx
+++ b/apps/studio/pages/project/[ref]/reports/index.tsx
@@ -24,7 +24,8 @@ export const UserReportPage: NextPageWithLayout = () => {
const reports = data.content
.filter((x) => x.type === 'report')
.sort((a, b) => a.name.localeCompare(b.name))
- if (reports.length > 1) router.push(`/project/${ref}/reports/${reports[0].id}`)
+ if (reports.length >= 1) router.push(`/project/${ref}/reports/${reports[0].id}`)
+ if (reports.length === 0) router.push(`/project/${ref}/reports/api-overview`)
},
})