Skip to content

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

chore: cleaner code

kishanhitkc0e9a1e7e8e1
diff --git a/studio/pages/api/v1/projects/[ref]/types/typescript.ts b/studio/pages/api/v1/projects/[ref]/types/typescript.ts
index 56fc47a33cc..fa62b486eb3 100644
--- a/studio/pages/api/v1/projects/[ref]/types/typescript.ts
+++ b/studio/pages/api/v1/projects/[ref]/types/typescript.ts
@@ -20,11 +20,26 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}
const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
- const includedSchema = 'public,graphql_public,storage'
- const excludedSchema =
- 'auth,cron,extensions,graphql,net,pgsodium,pgsodium_masks,realtime,supabase_functions,supabase_migrations,vault,_analytics,_realtime'
+ const includedSchema = ['public', 'graphql_public', 'storage'].join(',')
+
+ const excludedSchema = [
+ 'auth',
+ 'cron',
+ 'extensions',
+ 'graphql',
+ 'net',
+ 'pgsodium',
+ 'pgsodium_masks',
+ 'realtime',
+ 'supabase_functions',
+ 'supabase_migrations',
+ 'vault',
+ '_analytics',
+ '_realtime',
+ ].join(',')
const headers = constructHeaders(req.headers)
+
const response = await get(
`${PG_META_URL}/generators/typescript?included_schema=${includedSchema}&excluded_schemas=${excludedSchema}`,
{ headers }