classroom
classroom copied to clipboard
feat: Improve Teacher Feedback for Fetch Failures and Empty Classrooms
Checklist:
- [X] I have read freeCodeCamp's contribution guidelines.
- [X] My pull request has a descriptive title (not a vague title like
Update index.md)
Closes #606
Note:
This PR assumes that PR #603 is merged. It is currently rebased off of Abirami's branch: AbiramiR-27:fix/533-classes-mock-crash.
If changes are made to PR #603, this PR will need to be updated accordingly.
Description:
This PR changes fetchStudentData.js to return a structured response that contains a specific error message. The pages/dashboard/v2/[id].js page now takes this and displays the appropriate UI:
Empty Classroom:
Failed to Load Students, Other Error:
Happy Case. Students Loaded: