fix(frontend): leave the Supabase organization unset when the lookup misses

Falling back to the first organization named one the seeded project is not in,
since `supabaseSummary` prefers `intent.org` over the project's own. Unset, it
falls through to the project's organization identifier — the right one, spelled
as a slug rather than a name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-08-19 11:58:38 +02:00
co-authored by Claude Opus 5
parent 3f67f203b7
commit a50f99103c
@@ -56,11 +56,13 @@
}
// Seeded from the project, the way picking one does. Chosen independently, the
// review step names whichever organization happens to be first while the database
// under it belongs to another.
// under it belongs to another. A lookup that misses leaves it unset rather than
// falling back to the first: `supabaseSummary` then shows the project's own
// organization by identifier, which is right where a name would be wrong.
const seeded = intent.project
if (!intent.org) {
intent.org = seeded
? ((orgs ?? []).find((o) => orgSlug(o) === projectOrg(seeded)) ?? orgs?.[0])
? (orgs ?? []).find((o) => orgSlug(o) === projectOrg(seeded))
: orgs?.[0]
}
// The plan decides who gets billed, and the list endpoint does not carry it.