Skip to content

listing: skip amiChart findMany when no units carry an AMI chart#6316

Open
c-tonneslan wants to merge 1 commit into
bloom-housing:mainfrom
c-tonneslan:fix/skip-empty-amichart-findmany
Open

listing: skip amiChart findMany when no units carry an AMI chart#6316
c-tonneslan wants to merge 1 commit into
bloom-housing:mainfrom
c-tonneslan:fix/skip-empty-amichart-findmany

Conversation

@c-tonneslan

Copy link
Copy Markdown

Per the diagnosis @ludtkemorgan put in #5684: when addUnitsSummarized runs against a listing pulled with a view that doesn't select amiChart, every unit.amiChart?.id is undefined, unitsWithCharts ends up empty, and we still issue prisma.amiChart.findMany({ where: { id: { in: [] } } }). That's enough to trip up downstream callers expecting the base path not to hit the AMI chart table, which is what's breaking account/application/[id] (the listing title doesn't load).

Short-circuit findMany when unitsWithCharts is empty.

Closes #5684. Happy to also tackle the alternate framing (selecting amiChart in ListingView) in a follow-up if you'd rather fix it that way; the issue's listed both options.

When addUnitsSummarized runs against a listing pulled with a view that
doesn't select amiChart, every unit.amiChart?.id is undefined, so
unitsWithCharts ends up empty and we issue prisma.amiChart.findMany
with an 'in: []' filter. That's enough to trip up downstream callers
that expected the base path to not hit the AMI chart table at all,
which is what was happening on account/application/[id].

Short-circuit the findMany when unitsWithCharts is empty.

Closes bloom-housing#5684.

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
@netlify

netlify Bot commented May 17, 2026

Copy link
Copy Markdown

👷 Deploy request for bloom-angelopolis pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 553e1ee

@netlify

netlify Bot commented May 17, 2026

Copy link
Copy Markdown

👷 Deploy request for partners-bloom-msq2 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 553e1ee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: account/application/[id] not showing the listing name

1 participant