[+] Parse classInfos
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import {Component, Prop, Vue} from 'vue-property-decorator'
|
import {Component, Prop, Vue} from 'vue-property-decorator'
|
||||||
import App from '@/components/app/app';
|
import App from '@/components/app/app';
|
||||||
import CourseInfo, {UniqueCourse} from '@/logic/course-info';
|
import CourseInfo, {ClassInfo, UniqueCourse} from '@/logic/course-info';
|
||||||
import {GPAUtils} from '@/logic/utils/gpa-utils';
|
import {GPAUtils} from '@/logic/utils/gpa-utils';
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@@ -8,10 +8,11 @@ export default class CourseSelection extends Vue
|
|||||||
{
|
{
|
||||||
@Prop({required: true}) app: App
|
@Prop({required: true}) app: App
|
||||||
|
|
||||||
search: string = '';
|
search: string = ''
|
||||||
courseInfo: CourseInfo[] = []
|
courseInfo: CourseInfo[] = []
|
||||||
courseIdIndex: any = {} // Map<CourseID, index in courseInfo>
|
courseIdIndex: any = {} // Map<CourseID, index in courseInfo>
|
||||||
directory: {gradeLevel: number, classes: string}[] = []
|
directory: {gradeLevel: number, classes: string}[] = []
|
||||||
|
classes: ClassInfo[] = []
|
||||||
loading = true
|
loading = true
|
||||||
|
|
||||||
courseListHeight: number = 0;
|
courseListHeight: number = 0;
|
||||||
@@ -31,6 +32,7 @@ export default class CourseSelection extends Vue
|
|||||||
if (result.success)
|
if (result.success)
|
||||||
{
|
{
|
||||||
// Parse data
|
// Parse data
|
||||||
|
this.classes = result.data.classes.map((json: any) => new ClassInfo(json));
|
||||||
this.courseInfo = result.data.courseInfos.map((json: any, index: number) =>
|
this.courseInfo = result.data.courseInfos.map((json: any, index: number) =>
|
||||||
{
|
{
|
||||||
let info = new CourseInfo(json);
|
let info = new CourseInfo(json);
|
||||||
|
|||||||
Reference in New Issue
Block a user