mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Make sure that the Catalog shows same info for course run as the product page #2360

Closed annagav closed 2 weeks ago

annagav commented 2 weeks ago

As I was working on this https://github.com/mitodl/mitxonline/pull/2359 I looked through the catalog course card and it looked like the first relevant run for which we show info is not similar to the logic we use for picking first relevant run for the product page.

annagav commented 2 weeks ago

So for the catalog (Course.first_unexpired_run): we pick the earliest starting or started course run that is enrollable (non-archived preferred).

In the Course product page we are picking the run with the start date that is closest to now (if course.next_run_id is null).

Could not explain why we have getFirstRelevantRun calculation in the front end, if we are already passing next_run_id in the courses api. This is probably ready for some refactoring.