fix(web): use finalStack for Supabase checks

This commit is contained in:
Aman Varshney
2025-09-03 14:59:04 +05:30
parent 85f7ac2dcb
commit cbbed09fd0

View File

@@ -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;
};