fix: show org payment method for all team members on billing tab#2959
fix: show org payment method for all team members on billing tab#2959lohanidamodar merged 2 commits intomainfrom
Conversation
Fetch the organization's primary and backup payment methods via organizations.getPaymentMethod() instead of filtering account.listPaymentMethods(). The account endpoint only returns the current user's own cards, so if a different team member added the org's payment method it was invisible and the billing page incorrectly showed "Add a payment method". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes a bug where non-owner org members saw "Add a payment method" on the billing tab instead of the org's actual card, because Key changes:
Confidence Score: 5/5This PR is safe to merge — the fix is minimal, targeted, and correct. No P0 or P1 issues remain. The root cause is correctly identified and the fix uses the right API endpoint. Promise.all handles null entries as already-resolved values so the null-coalescing pattern is safe, .catch(() => null) prevents hard failures, and Dependencies.ORGANIZATION already covers cache invalidation when payment method IDs change. The previously flagged type annotation issue is a non-breaking cosmetic concern with strict: false. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: correct type annotations for paymen..." | Re-trigger Greptile |
src/routes/(console)/organization-[organization]/billing/+page.ts
Outdated
Show resolved
Hide resolved
Promise type should include null for both the resolved value (.catch(() => null)) and the ternary false branch (null). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
account.listPaymentMethods()which only returns the current user's own cardsorganizations.getPaymentMethod()to fetch the org's primary and backup payment methods directly by ID, so they display correctly for all team membersaccount.listPaymentMethods()is still used for the "change/replace payment method" dropdown since users can only assign their own cardsTest plan
🤖 Generated with Claude Code