mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
Redirect to API report when there are 0 reports (#28145)
* redirect to api report when there are 0 reports * Update apps/studio/pages/project/[ref]/reports/index.tsx Co-authored-by: Alaister Young <alaister@users.noreply.github.com> --------- Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
This commit is contained in:
1 parent
4496c5a9ab
commit
fe8aec6070
1 file changed
+2
-1
@@ -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`)
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user