Skip to content

refactor: migrate enrollment API calls from v1 to v2#1938

Draft
taimoor-ahmed-1 wants to merge 1 commit into
openedx:masterfrom
edly-io:taimoor-ahmed/migrate-enrollment-api-v2
Draft

refactor: migrate enrollment API calls from v1 to v2#1938
taimoor-ahmed-1 wants to merge 1 commit into
openedx:masterfrom
edly-io:taimoor-ahmed/migrate-enrollment-api-v2

Conversation

@taimoor-ahmed-1

Copy link
Copy Markdown

Summary

Migrates both enrollment API call sites in Learning from /api/enrollment/v1/enrollment to /api/enrollment/v2/enrollment/, per the FC-0118 API standardization on openedx/edx-platform.

File Verb Screen
src/courseware/course/course-exit/data/api.js GET Course Exit — list enrollments for recommendations
src/alerts/enrollment-alert/data/api.js POST Enrollment Alert — enroll from the outline

The trailing slash on /enrollment/ is required: the v2 endpoint is served by a DRF DefaultRouter, and the POST caller would otherwise fail (Django won't redirect a POST across the missing slash).

Test URL assertions updated in CourseExit.test.jsx and OutlineTab.test.jsx.

Dependency

⚠️ Requires the Enrollment v2 API on the LMS (FC-0118, openedx/edx-platform PR #38724). Must be released before this is deployed.

Test plan

  • npm testCourseExit.test.jsx and OutlineTab.test.jsx pass with updated URL assertions
  • Manual: recommendations on course exit + enroll-from-outline alert work against an LMS with v2 enabled

Closes #1936

🤖 Generated with Claude Code

Migrates both enrollment call sites from /api/enrollment/v1/enrollment
to /api/enrollment/v2/enrollment/ (trailing slash required by the v2
DRF DefaultRouter):
  - course-exit/data/api.js       GET  (list enrollments for recommendations)
  - alerts/enrollment-alert/data/api.js  POST (enroll from outline alert)

Test URL assertions updated accordingly in CourseExit.test.jsx and
OutlineTab.test.jsx.

Part of the FC-0118 API standardization (openedx/edx-platform).

Closes openedx#1936

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 10, 2026
@openedx-webhooks

openedx-webhooks commented Jul 10, 2026

Copy link
Copy Markdown

Thanks for the pull request, @taimoor-ahmed-1!

This repository is currently maintained by @openedx/committers-frontend-app-learning.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.41%. Comparing base (b931504) to head (5e99a69).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1938   +/-   ##
=======================================
  Coverage   91.41%   91.41%           
=======================================
  Files         347      347           
  Lines        5777     5777           
  Branches     1351     1385   +34     
=======================================
  Hits         5281     5281           
  Misses        477      477           
  Partials       19       19           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

Migrate Enrollment API callers from v1 to v2 (FC-0118)

2 participants