From cbbed09fd0821a4d7bcc70e38ac738a19145360e Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 3 Sep 2025 14:59:04 +0530 Subject: [PATCH] fix(web): use finalStack for Supabase checks --- .../web/src/app/(home)/new/_components/utils.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/(home)/new/_components/utils.ts b/apps/web/src/app/(home)/new/_components/utils.ts index ed5de0b..df910d7 100644 --- a/apps/web/src/app/(home)/new/_components/utils.ts +++ b/apps/web/src/app/(home)/new/_components/utils.ts @@ -1293,7 +1293,7 @@ export const getDisabledReason = ( finalStack.database === "none" && optionId !== "none" ) { - return "ORM requires a database. Select a database first (SQLite, PostgreSQL, MySQL, or MongoDB)."; + return "ORM requires a database. Select a database first (SQLite, PostgreSQL, or MongoDB)."; } if ( @@ -1584,6 +1584,21 @@ export const getDisabledReason = ( } } + if (category === "dbSetup" && optionId === "supabase") { + if ((finalStack.database as string) !== "postgres") { + return "Supabase requires PostgreSQL database. Select PostgreSQL first."; + } + } + + if ( + category === "database" && + (finalStack.dbSetup as string) === "supabase" + ) { + if (optionId !== "postgres") { + return "Selected DB Setup 'Supabase' requires PostgreSQL. Select PostgreSQL or change DB Setup."; + } + } + return null; };