Skip to content

[HIGH] Enrollment count only queries first course on page #26

Description

@DeFiVC

Description

In src/modules/courses/course.service.ts:49-51, the enrollment count query uses eq(enrollments.courseId, courseIds[0]) — only filtering for the first course ID. All other courses on the page get enrollment count 0.

Impact

The enrolledCount field in course listings is wrong for every course except the first.

File

src/modules/courses/course.service.ts:49-51

Suggested Fix

Replace eq(enrollments.courseId, courseIds[0]) with inArray(enrollments.courseId, courseIds).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workinghigh

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions