Skip to content

refactor: migrate dashboard pages to useApi#35

Closed
xx7412421-cloud wants to merge 6 commits into
StableRoute-Org:mainfrom
xx7412421-cloud:patch-2
Closed

refactor: migrate dashboard pages to useApi#35
xx7412421-cloud wants to merge 6 commits into
StableRoute-Org:mainfrom
xx7412421-cloud:patch-2

Conversation

@xx7412421-cloud

@xx7412421-cloud xx7412421-cloud commented Jun 21, 2026

Copy link
Copy Markdown

Closes #9

Summary

  • migrate pairs and events dashboard pages from bespoke useEffect/apiGet state to the shared useApi hook
  • map loading, error, and ok states to Spinner, role="alert", empty states, and list rendering
  • add useApi coverage for success, error, null path, and unmount-during-fetch cancellation
  • add page tests for loading, success, empty, and error states on both migrated pages
  • document the shared read-only data fetching pattern in the README

Validation

  • npm ci
  • npm test -- src/lib/tests/useApi.test.tsx src/app/pairs/page.test.tsx src/app/events/page.test.tsx --runInBand
  • npm test -- --runInBand
  • npm run build
  • npm run lint

Use the shared useApi hook for pairs loading, error, and ok states.
Use the shared useApi hook for event loading, error, and ok states.
Cover success, error, null path, and cancelled in-flight requests for the shared hook.
Cover loading, success, empty, and error rendering for the pairs page.
Cover loading, success, empty, and error rendering for the events page.
Document the shared useApi loading, error, and ok state pattern for read-only dashboard pages.
@xx7412421-cloud xx7412421-cloud changed the title Patch 2 refactor: migrate dashboard pages to useApi Jun 21, 2026
@mikewheeleer

Copy link
Copy Markdown
Contributor

hey @xx7412421-cloud, thanks for the effort here 🙏 issue #9 isn't assigned to you though — to keep the campaign fair and avoid duplicate work, please claim/get assigned to it first, then open your PR. closing for now; would love to see it back once it's assigned to you 🙌

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.

Migrate dashboard pages to the shared useApi hook for consistent fetch state

2 participants