implemented course fetch functionality#284
Merged
Merged
Conversation
Contributor
|
@chiscookeke11 Thanks for your work! |
|
i can type oh. Guess this is opensource. Na you hot this period @chiscookeke11 👏🏽 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
🔗 Close #272
📋 Description
This PR integrates the Course Listing (coursesPage) with a live backend API, replacing the previous static/mock data implementation.
✅ What This PR Implements
Connected
src/app/coursesPage/page.tsxto fetch real course data via:Implemented pagination with infinite scroll using
IntersectionObserverAdded proper loading state handling:
Prevented duplicate course rendering during pagination
Implemented graceful handling for:
Maintained client-side filtering (search, category, level) on fetched data
🧪 How I Tested This
Since a backend was not available in the repository, I:
Set up a local NestJS backend
Implemented:
Configured proper pagination using:
skip: (page - 1) * limittake: limitSeeded the database with 30 course records
Verified:
🎥 Screen Recording
Loom Demo:
https://www.loom.com/share/31cc25cfc5a8405990e48f11d360f7a3
The recording demonstrates:
📂 Screenshots
(See Loom link above for full walkthrough.)
🔍 Additional Notes
Infinite scrolling is implemented via
IntersectionObserverfor performance efficiency.Loading states are separated into:
initialLoadingloadingMoreDuplicate course entries are prevented by ID checks before appending to state.
No new external dependencies were introduced.
Backend used for testing was local and not committed to this repository.
Potential Reviewer Attention
{ data, totalCount }for improved pagination control.🙏 Thank you for reviewing this implementation!