Skip to content

FAC-WEB fix: scope student courses page to current term (#157)#158

Merged
y4nder merged 1 commit into
mainfrom
release/main/scope-student-courses
Apr 25, 2026
Merged

FAC-WEB fix: scope student courses page to current term (#157)#158
y4nder merged 1 commit into
mainfrom
release/main/scope-student-courses

Conversation

@y4nder

@y4nder y4nder commented Apr 25, 2026

Copy link
Copy Markdown
Member

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.

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.
@y4nder y4nder self-assigned this Apr 25, 2026
@vercel

vercel Bot commented Apr 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app-faculytics Ready Ready Preview, Comment Apr 25, 2026 2:47am

@y4nder y4nder merged commit a341f1f into main Apr 25, 2026
3 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.

FAC-WEB fix: students see enrollments from all semesters (scope /enrollments/me to current term)

1 participant