From 7837657d9f58c335349728b7961e6df4a5578ab4 Mon Sep 17 00:00:00 2001
From: "jvanboxtel@wisc.edu" <jvanboxtel@wisc.edu>
Date: Mon, 4 Mar 2019 13:49:18 -0600
Subject: [PATCH] Fix for add course bug

---
 .../course-details/course-details.component.ts     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/app/shared/components/course-details/course-details.component.ts b/src/app/shared/components/course-details/course-details.component.ts
index 3cba5ee..1d7c0a0 100644
--- a/src/app/shared/components/course-details/course-details.component.ts
+++ b/src/app/shared/components/course-details/course-details.component.ts
@@ -1,13 +1,15 @@
-import { Observable, Subscription } from 'rxjs';
 import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
-import { CourseDetails } from '../../../core/models/course-details';
 import { MAT_DIALOG_DATA } from '@angular/material';
+import { FormBuilder, FormGroup } from '@angular/forms';
+import { Observable, Subscription } from 'rxjs';
+import { distinctUntilChanged, map } from 'rxjs/operators';
+import { Store, select } from '@ngrx/store';
+
+import { CourseDetails } from '@app/core/models/course-details';
 import * as selectors from '@app/degree-planner/store/selectors';
 import * as utils from '@app/degree-planner/shared/utils';
+import { TermCode } from '@app/core/models/termcode';
 import { GlobalState } from '@app/core/state';
-import { Store, select } from '@ngrx/store';
-import { distinctUntilChanged, map } from 'rxjs/operators';
-import { FormBuilder, FormGroup } from '@angular/forms';
 
 import {
   AddCourse,
@@ -68,7 +70,7 @@ export class CourseDetailsComponent implements OnInit, OnDestroy {
 
   addCourseToPlan($event) {
     $event.preventDefault();
-    const termCode = this.termSelector.value.term;
+    const termCode = new TermCode(this.termSelector.value.term);
     const subjectCode = this.courseDetails.subject.subjectCode;
     const courseId = this.courseDetails.courseId;
     const payload = {
-- 
GitLab