Skip to content

Frontend: Courses — connect courses list to real API#196

Merged
Hexstar-labs merged 2 commits intoBrainTease:mainfrom
teslims2:courses-api-fetch
Mar 30, 2026
Merged

Frontend: Courses — connect courses list to real API#196
Hexstar-labs merged 2 commits intoBrainTease:mainfrom
teslims2:courses-api-fetch

Conversation

@teslims2
Copy link
Copy Markdown
Contributor

@teslims2 teslims2 commented Mar 29, 2026

PR: Courses API fetch + filtering + pagination

Summary

Replace hardcoded /courses content with API-backed listing:

  • GET /courses with search, level, page, and limit
  • Replaces mock array in apps/frontend/src/app/courses/page.tsx
  • Adds URL query sync and router push to maintain state
  • Adds search input and level filter dropdown
  • Adds pagination (Previous / Next) and page state
  • Shows loading skeleton while fetching
  • Shows empty state when no courses match

Implementation details

  • apps/frontend/src/app/courses/page.tsx (client component with SWR)
  • apps/frontend/src/app/[locale]/courses/page.tsx reuses the same component
  • apps/frontend/src/__tests__/pages/CoursesPage.test.tsx ensures API behavior and filtering
  • apps/frontend/src/__tests__/mocks/handlers.ts added a dynamic handler for /courses query paths
  • apps/frontend/package.json added dependency swr

Notes

Verifications

  • get_errors shows no errors in changed files
  • (Local test run not executed due environment dependency state; run npm test or needed install when available.)

Closes #36

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@teslims2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Hexstar-labs Hexstar-labs merged commit ad86d61 into BrainTease:main Mar 30, 2026
3 of 13 checks passed
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.

Frontend: Courses — connect courses list to real API

2 participants