FAC-WEB fix: scope student courses page to current term (#157)#158
Merged
Conversation
GET /enrollments/me returns every semester the student has ever been
enrolled in. Before S12526 backfill each student had exactly one term
of data, so listing everything was fine — but once past semesters land
alongside the current one, the Courses page would render duplicate
entries and the "enrolled in N courses this semester" copy becomes a
lie.
Resolve the current academic term client-side (no backend change
needed — FAC-146 exposed startDate/endDate on GET /semesters) and
filter the enrollments list to matching semester.id.
- resolveCurrentSemester(): picks the semester where startDate <= now
< endDate, falls back to the most recent by startDate DESC so the
page isn't blank between terms.
- useCurrentStudentTerm(): chains useMe + useSemesterOptions to
resolve the student's current term; returns a discriminated union
so the page can handle loading / error / no-campus / no-semester /
ready cleanly.
- Subtitle now shows the actual term label ("Semester 2, AY 2025-2026").
- SemesterOptionDto type extended with startDate/endDate to match
the FAC-146 API response.
Closes #156.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
GET /enrollments/me returns every semester the student has ever been enrolled in. Before S12526 backfill each student had exactly one term of data, so listing everything was fine — but once past semesters land alongside the current one, the Courses page would render duplicate entries and the "enrolled in N courses this semester" copy becomes a lie.
Resolve the current academic term client-side (no backend change needed — FAC-146 exposed startDate/endDate on GET /semesters) and filter the enrollments list to matching semester.id.
Closes #156.