Follow-up from PR #223 review.
useTrade(id) fetches the full trade list via apiClient.getTrades() (default limit=50) and filters client-side. Trades beyond the first page are invisible to detail views.
Options:
- Add a
GET /api/v1/trades/:id backend endpoint (cleanest)
- Increase the limit to a higher value when fetching for single-trade lookup
- Share the query cache with
useTrades so already-fetched pages are searched first
Also related: useTrades and useTrade use different query keys (['trades', limit, offset] vs ['trades', id]), so two hooks mounted simultaneously fire two full-list fetches. Consider sharing the base query or using queryClient.getQueryData to check the cache before fetching.
Follow-up from PR #223 review.
useTrade(id)fetches the full trade list viaapiClient.getTrades()(default limit=50) and filters client-side. Trades beyond the first page are invisible to detail views.Options:
GET /api/v1/trades/:idbackend endpoint (cleanest)useTradesso already-fetched pages are searched firstAlso related:
useTradesanduseTradeuse different query keys (['trades', limit, offset]vs['trades', id]), so two hooks mounted simultaneously fire two full-list fetches. Consider sharing the base query or usingqueryClient.getQueryDatato check the cache before fetching.