-
}
- >
-
- Schemas
-
- {openSchemas.map((schema) => (
-
schema}
- >
- {schema.name}
-
- ))}
-
+ )}
+
+ {isError &&
}
+
+ {isSuccess && (
+
}
>
-
Protected schemas
-
- {protectedSchemas.map((schema) => (
-
schema}
- >
- {schema.name}
+
+ Schemas
- ))}
-
+ {openSchemas.map((schema) => (
+ schema}
+ >
+ {schema.name}
+
+ ))}
+
+ Protected schemas
+
+ {protectedSchemas.map((schema) => (
+ schema}
+ >
+ {schema.name}
+
+ ))}
+
+ )}
diff --git a/studio/pages/project/[ref]/editor/[id].tsx b/studio/pages/project/[ref]/editor/[id].tsx
index 31b390bbf67..0b31931bf2b 100644
--- a/studio/pages/project/[ref]/editor/[id].tsx
+++ b/studio/pages/project/[ref]/editor/[id].tsx
@@ -5,9 +5,11 @@ import DeleteConfirmationDialogs from 'components/interfaces/TableGridEditor/Del
import { TableEditorLayout } from 'components/layouts'
import { ProjectContextFromParamsProvider } from 'components/layouts/ProjectLayout/ProjectContext'
import useTable from 'hooks/misc/useTable'
+import { useRouter } from 'next/router'
import { NextPageWithLayout } from 'types'
const TableEditorPage: NextPageWithLayout = () => {
+ const router = useRouter()
const { isDarkMode } = useTheme()
const { id: _id, ref: projectRef } = useParams()
const id = _id ? Number(_id) : undefined
@@ -21,7 +23,18 @@ const TableEditorPage: NextPageWithLayout = () => {
selectedTable={selectedTable}
theme={isDarkMode ? 'dark' : 'light'}
/>
-
+
{
+ // For simplicity for now, we just open the first table within the same schema
+ if (tables.length > 0) {
+ router.push(`/project/${projectRef}/editor/${tables[0].id}`)
+ } else {
+ router.push(`/project/${projectRef}/editor/`)
+ }
+ }}
+ />
>
)
}