Skip to content

feat: add GET /api/v1/courses/:id/enrolled-users admin endpoint - #451

Merged
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
anuoluwaponiorimi:feat/enrolled-users-endpoint-355-343-349-361
Sep 1, 2026
Merged

feat: add GET /api/v1/courses/:id/enrolled-users admin endpoint#451
DeFiVC merged 2 commits into
ChainLearnOfficial:mainfrom
anuoluwaponiorimi:feat/enrolled-users-endpoint-355-343-349-361

Conversation

@anuoluwaponiorimi

Copy link
Copy Markdown
Contributor

Summary

  • . Add GET /api/v1/courses/:id/enrolled-users endpoint (admin) #355: Added GET /api/v1/courses/:id/enrolled-users — an admin-only endpoint returning a paginated list of users enrolled in a course, joined with their progress: userId, displayName, stellarAddress, enrolledAt, completedAt, quizCount, averageScore (computed from quizSubmissions joined to quizzes scoped to the course). Guarded by authGuard + adminGuard, matching the existing admin route pattern in this router. Cached 30s per (courseId, page, limit), mirroring getCourseReviews's cache-aside pattern.

Test plan

  • GET /api/v1/courses/:id/enrolled-users as a non-admin returns 403
  • As an admin, returns paginated enrolled users with correct quizCount/averageScore per user
  • Repeated calls within 30s hit the cache (no duplicate DB queries in logs)
  • Unknown course ID returns 404

Closes #355
Closes #343
Closes #349
Closes #361

- ChainLearnOfficial#355: New admin-only endpoint returning a paginated list of users
  enrolled in a course, joined with per-user progress: userId,
  displayName, stellarAddress, enrolledAt, completedAt, quizCount,
  averageScore (computed from quizSubmissions joined to quizzes for
  this course). Guarded by authGuard + adminGuard, matching the
  existing admin route pattern. Cached 30s per (courseId, page, limit),
  mirroring getCourseReviews's cache-aside pattern.

Closes ChainLearnOfficial#355
Closes ChainLearnOfficial#343
Closes ChainLearnOfficial#349
Closes ChainLearnOfficial#361
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@anuoluwaponiorimi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@DeFiVC
DeFiVC merged commit 997a17c into ChainLearnOfficial:main Sep 1, 2026
3 of 5 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

2 participants