Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve empty enrollment history entries #64

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

waterkimchi
Copy link
Contributor

Description

Fixed the issue where the enrollment history endpoint was returning entries for terms without enrollment data. Now, the endpoint only returns entries for terms with actual enrollment data, ensuring that each entry has at least one data point.

Related Issue

This pull request addresses issue #31.

Motivation and Context

This change is required to prevent unintentional behavior in consumers of the enrollment history endpoint. By ensuring that only terms with enrollment data are returned, we avoid empty data arrays that could cause issues or unexpected behavior in downstream applications.

How Has This Been Tested?

Tested on a local deployment by using the pnpm environment. Minor changes. None affects other code.

Screenshots (if appropriate):

Before(includes the empty data sections):
Screenshot 2025-01-06 at 09 54 58
After(removed the empty data sections):
Screenshot 2025-01-06 at 09 55 21

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code involves a change to the database schema.
  • My code requires a change to the documentation.

@waterkimchi waterkimchi changed the title Fix: Resolve empty enrollment history entries #31 Fix issue #31: Resolve empty enrollment history entries Jan 6, 2025
@andrew-wang0 andrew-wang0 self-requested a review January 8, 2025 02:37
@andrew-wang0 andrew-wang0 changed the title Fix issue #31: Resolve empty enrollment history entries fix: resolve empty enrollment history entries Jan 8, 2025
Copy link
Member

@andrew-wang0 andrew-wang0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Just a few syntactic changes and it should be good to go 🫡

apps/api/src/services/enrollment-history.ts Outdated Show resolved Hide resolved
apps/api/src/services/enrollment-history.ts Outdated Show resolved Hide resolved
Copy link
Member

@andrew-wang0 andrew-wang0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good!

@andrew-wang0 andrew-wang0 merged commit e6a77a1 into icssc:main Jan 15, 2025
1 check failed
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.

3 participants