You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #193 introduced two near-identical helpers for prefetching per-account AccountServiceOverride data into a Map<accountID, AccountServiceOverride[]> cache:
openFanOutModal (sub-option ii) — collects single-account-bucket account IDs, fetches via Promise.all, swallows per-account errors, passes the cache to resolveBucketPaymentSeed.
openPurchaseModal (sub-option iii) — collects all rec account IDs, fetches via Promise.all, swallows per-account errors, passes the cache to resolvePerRecPaymentSeed.
The fetch+cache shape is ~10 lines and identical aside from "which account IDs do we collect?". The seed functions themselves are different (per-bucket vs per-rec), so they don't merge — but the prefetch wrapper does.
Then openFanOutModal and openPurchaseModal each become a 1-line call.
Bonus: single mock target for tests
The existing tests mock api.listAccountServiceOverrides directly. After this refactor, they could either keep doing that (the helper still calls the same API) or mock the new helper directly for cleaner test fixtures.
Activity
refactor(frontend): consolidate account-overrides prefetch helper (cl…
refactor(frontend): consolidate account-overrides prefetch helper (cl…
refactor(frontend): consolidate account-overrides prefetch helper (cl…
refactor(frontend): consolidate account-overrides prefetch helper (cl…