openedx / openedx/frontend-app-learning
Migrate Enrollment API callers from v1 to v2 (FC-0118)
@taimoor-ahmed-1 is already working on this.
Since Sep 1, 2026.
- Dominant language
- JavaScript
- Stars
- 70
- Forks
- 335
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 35
Description
Summary
The Enrollment REST API on edx-platform has been standardized under FC-0118 (ADRs 0025–0040) and re-released as /api/enrollment/v2/. frontend-app-learning is one of four MFEs that currently call the v1 endpoints and needs to migrate.
The v1 endpoints remain live (no immediate breakage). The v2 endpoints add a standardized error envelope, OpenAPI 3.x schemas, and consistent auth (JwtAuthentication + SessionAuthenticationAllowInactiveUser, no BearerAuthentication/OAuth2Authentication).
Endpoints to migrate
| Old URL | New URL |
|---|---|
GET /api/enrollment/v1/enrollment |
GET /api/enrollment/v2/enrollment/ |
POST /api/enrollment/v1/enrollment |
POST /api/enrollment/v2/enrollment/ |
Call sites (grepped 2026-07-03)
GET /api/enrollment/v1/enrollment — list caller's enrollments
src/courseware/course/course-exit/data/api.js:32,35— Course Exit / recommendations screen
POST /api/enrollment/v1/enrollment — enroll
src/alerts/enrollment-alert/data/api.js:6,7— Enrollment Alert banner on the outline (postCourseEnrollment)
Tests referencing the v1 URL (update alongside):
src/course-home/outline-tab/OutlineTab.test.jsx
Notes on the response envelope
Errors now follow the ADR 0029 standardized format. Code that reads response.data.detail may need to read response.data.error.detail. Success payloads are unchanged.
References
- edx-platform PRs #38724, #38773, #38796
- FC-0118 ADRs:
docs/decisions/0025-*through0040-*on edx-platform
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.