Skip to content
Snippets Groups Projects
Commit 53fc7952 authored by Isaac Evavold's avatar Isaac Evavold
Browse files

ROENROLL-1508 fix add course to non-primary plan

parent 4370fdff
No related branches found
No related tags found
No related merge requests found
......@@ -131,8 +131,11 @@ export class CourseEffects {
const { subjectCode, termCode, courseId, newIndex } = action.payload;
let addCourse$: Observable<CourseBase>;
// When adding to an active term use cart endpoint
if (activeTerms.find(term => term.equals(termCode))) {
const isActiveTerm = activeTerms.filter(term => term.equals(termCode));
const isPrimaryPlan = visibleDegreePlan
? visibleDegreePlan.primary
: false;
if (isActiveTerm && isPrimaryPlan) {
addCourse$ = this.api.addCourseToCart(subjectCode, courseId, termCode);
} else {
addCourse$ = this.api.addCourse(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment